feat(agentic-week2-4): 5 major features — AI content generator, handoff, tags, soft-delete, SSE
CognxSafeTrack+1: Claude Sonnet 4.6
99f6bca
## Agent Créateur de Contenu (Semaine 3)
- AIService.generateCurriculum() — structured GPT-4o prompt generates full Track + TrackDays
- POST /v1/organizations/:id/content/ai-generate — persists curriculum directly to DB
- TrackListPage: "Générer avec IA" button + modal (description, numDays, language, audience)
- Auto-redirects to the generated program days after creation
## Human Handoff Detection (Semaine 4)
- AIAgentHandler: detects 15 multilingual handoff keywords (FR/EN/ES)
- Sets Redis flag handoff:{userId}:{orgId} (24h) — pauses AI responses
- Emails org admin with contact info + link to admin UI
- Handles subsequent messages while in handoff mode gracefully
## Contact Segmentation by Tags (Semaine 2)
- Contact.tags String[] added to Prisma schema (migration + db:push applied)
- GET /contacts/tags — list all unique tags in org
- PATCH /contacts/:id/tags — set tags on a contact
- GET /contacts?tags=tag1,tag2 — filter contacts by tags (hasSome)
## SSE Real-time Updates (Semaine…
refactor(debt): resolve all 10 technical debt items from audit
CognxSafeTrack+1: Claude Sonnet 4.6
a966957
- Redis: singleton pattern (lib/redis.ts) in api + worker, removes 16+ new Redis() calls
- Meta token: systemUserTokenIssuedAt field + weekly cron monitor (warn @50d, critical @55d)
- Rate limiting: @fastify/rate-limit global 200/min, login 10/min, forgot-password 3/min
- Dead code: delete WhatsAppConnectButton.tsx, archive one-off scripts
- Silent catches: logger.warn(err) on all backend catch blocks, console.warn on frontend
- Meta API types: 5 typed interfaces replace 6 as any casts in organization.ts
- Frontend logger: lib/logger.ts wraps Sentry (active when VITE_SENTRY_DSN is set)
- Migration: add systemUserTokenIssuedAt + metaBusinessId to Organization schema
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>