iachat/enterprise/app/controllers/api/v1/accounts/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_responses_controller.rb Merge branch 'main' into chore/merge-upstream-4.6.0 2025-09-19 19:37:28 -03:00
assistants_controller.rb feat: Adiciona prompt orquestrador configurável para assistentes Captain com editor UI. 2026-02-27 11:57:59 -03:00
bulk_actions_controller.rb chore: apply Rails/SaveBang cop (#15) 2025-04-03 23:29:24 -03:00
copilot_messages_controller.rb fix: Update specs, add background response job implementation for copilot threads (#11600) 2025-05-27 14:10:27 -06:00
copilot_threads_controller.rb chore: Disable copilot usage after the response count is over (#11845) 2025-06-30 19:06:25 -07:00
custom_tools_controller.rb Merge branch main into chore/merge-upstream-4.7.0 2025-10-16 12:08:20 -03:00
documents_controller.rb Merge branch 'main' into chore/merge-upstream-4.6.0 2025-09-19 19:37:28 -03:00
gallery_items_controller.rb feat(units): allow one Pix unit to link to multiple inboxes (N:N) 2026-02-26 21:33:23 -03:00
inboxes_controller.rb chore(style): fix rubocop offenses and update typing indicators 2026-02-25 15:06:58 -03:00
lifecycle_configs_controller.rb feat(lifecycle): REST endpoint for lifecycle config singleton 2026-04-15 10:23:42 -03:00
lifecycle_deliveries_controller.rb feat(lifecycle): REST endpoint for lifecycle deliveries audit log 2026-04-15 10:29:24 -03:00
lifecycle_rules_controller.rb feat(lifecycle): REST endpoint for lifecycle rules CRUD 2026-04-15 10:17:59 -03:00
notification_templates_controller.rb refactor: move notification templates de units para inboxes 2026-03-01 22:17:27 -03:00
reservations_controller.rb feat(captain): semantic memory fixes + roleta + reclamações + analytics 2026-04-21 15:36:25 -03:00
roleta_controller.rb feat(captain): semantic memory fixes + roleta + reclamações + analytics 2026-04-21 15:36:25 -03:00
scenarios_controller.rb feat(captain): semantic memory fixes + roleta + reclamações + analytics 2026-04-21 15:36:25 -03:00
tasks_controller.rb feat: new Captain Editor (#13235) 2026-01-21 13:39:07 +05:30