iachat/spec/enterprise/services/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 fix(captain): remove scenario->orchestrator back-handoff (ping-pong) 2026-04-19 11:30:19 -03:00
contact_memories fix(captain-memory): temporal memory model + aggressive dedup 2026-04-19 08:30:42 -03:00
copilot chore: fix linting 2025-12-20 12:55:27 -03:00
inter chore(style): fix rubocop offenses and update typing indicators 2026-02-25 15:06:58 -03:00
lifecycle test(lifecycle): add end-to-end integration spec for scheduler→dispatch→send flow 2026-04-15 09:29:52 -03:00
llm fix: captain assistant image comprehension (#13390) 2026-01-28 16:07:13 -08:00
onboarding feat: legacy features to ruby llm (#12994) 2025-12-11 14:17:28 +05:30
reports feat(captain): semantic memory fixes + roleta + reclamações + analytics 2026-04-21 15:36:25 -03:00
reservations chore(style): fix rubocop offenses and update typing indicators 2026-02-25 15:06:58 -03:00
tools ajuste galeria de imagens 2026-02-26 15:27:25 -03:00
open_ai_message_builder_service_spec.rb Merge branch 'main' into chatwoot/develop 2025-07-16 09:37:08 -03:00
tool_registry_service_spec.rb feat: Update UI for Copilot (#11561) 2025-06-02 22:02:03 -05:00