Commit History
-
docs: add developer audit guide (2026-05-15)
CognxSafeTrack5e23bc3 -
feat(admin): add Direct Setup button for super admins on orgs without phone number
CognxSafeTrack- Add "Direct Setup" button (super admin only) on /clients for orgs without a WhatsApp number - Previously the setup modal was only reachable via the Reconfigure button (orgs with a phone) - Add i18n keys: clients.actions.direct_setup (en/fr/pt) - Add scratch scripts for org configuration and DB queries - Add doc: configurer-token-nouvelle-org.md — how to configure a Meta token on a new orga3df350 -
docs: add HuggingFace → Railway migration plan
CognxSafeTrack17a3e29 -
docs: add post-mortems for Meta API deprecation, SSE 401 and file import bugs
CognxSafeTrackb8d93e2
-
feat(jour11+schema): Jour 11 photoUrl on TeamMember + audit doc updates
CognxSafeTrack +1: Claude Sonnet 4.6- TeamMember.photoUrl: new optional field stores the original WhatsApp image URL alongside the AI-extracted name/role/bio - extractAndSaveTeamMember(): now persists photoUrl field - Migration 20260513000003_add_team_member_photo_url - Audit doc: mark Semaine 3-4 fully complete, add Stripe + Jour 11 items Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>61fd7f5 -
feat(agentic-week2-4): 5 major features — AI content generator, handoff, tags, soft-delete, SSE
CognxSafeTrack +1: Claude Sonnet 4.6## 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…99f6bca -
feat(agentic-week1): conversational memory, RAG threshold, wallet alerts, weekly reports, campaign scheduling
CognxSafeTrack +1: Claude Sonnet 4.6- AIAgentHandler: Redis sliding window (20 entries, TTL 24h) for conversation history injected into system prompt — AI_AGENT now remembers context - IndexingService.searchRelevantContext: cosine threshold 0.70 — returns '' if no chunk is relevant so agent responds honestly instead of hallucinating - add-hnsw-index.ts: one-shot HNSW index script (m=16, ef=64) for ~10x faster pgvector cosine search on large knowledge bases - scheduler.ts: hourly wallet alert (email via Brevo if < 3 days runway, 6h Redis suppression) + weekly report every Monday 07:00 UTC with trend vs previous week and color-coded wallet status - queue.ts + campaigns.ts: sendAt ISO-8601 parameter on broadcast/campaign routes — BullMQ delay option schedules jobs natively, no cron needed - docs/agentic/: roadmap updated with Semaine 1 marked complete Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>98240fd -
docs(wallet): add full wallet/ledger implementation plan
CognxSafeTrackbb0f29f -
docs(business): update economic model — wallet/ledger decision v2.0
CognxSafeTrack7e22952 -
feat(billing): enforce AI credit limits across all surfaces
CognxSafeTrack +1: Claude Sonnet 4.6- credit-guard.ts (worker): assertCredits() blocks AI when creditsUsed >= creditsLimit; Redis cache 60s prevents DB hit on every message - whatsapp-logic.ts: credit guard injected before handler chain; RECHARGE keyword bypasses the guard so users can always request a payment link - CommandHandler: new RECHARGE keyword sends payment URL or contact message - i18n: credit_exhausted + recharge_link + recharge_contact in 5 languages - requireCredits middleware (api): 402 on personalize-lesson, tts, generate-feedback, crm/generate-campaign - billing route: POST /v1/billing/admin/allocate (SUPER_ADMIN only) supports set/add actions + optional usage reset + Redis cache invalidation - ClientsManagementView: "Crédits IA" button (SUPER_ADMIN only) per org opens allocation modal with set/add/reset controls - BillingPage: red exhaustion banner when creditsUsed >= creditsLimit Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>6484585
-
feat(billing): complete billing system, push notifications, and tech debt fixes
CognxSafeTrack +1: Claude Sonnet 4.6- Usage tracking: instrument pedagogy, audio transcription, AI Agent mode (was silently untracked) - EmailHandler: implement templates 2 (password reset), 3 (quota alert), 4 (monthly report) - Quota alert: auto-queue email + push at 85% threshold via maybeQueueQuotaAlert - Push notifications: PushHandler + send-push BullMQ job; sendPushToUser scoped by organizationId to prevent cross-tenant reads - BillingPage: add credit recharge modal with 3 packs, null guard for missing orgId - i18n: add nav.billing key in fr/en/es/pt locales - Tests: billing.test.ts (10 tests), payments.test.ts (13 tests) - Tech debt: fix empty catch blocks in ai-pedagogy.ts, exclude usage tokens from CRM API response, pass organizationId to generateChat in AIAgentHandler - Docs: add backlog and business model to docs/business/ Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>8280d7d -
fix(bot): eliminate double feedback, fix gemini model, fix multilingual prompts
CognxSafeTrack +1: Claude Sonnet 4.61. Double feedback (critical): Bridge was enqueuing both download-media AND handle-inbound for every audio/image message. Both paths independently transcribed the audio and called WhatsAppLogic.handleIncomingMessage → two generate-feedback jobs → user received two Coach responses. Fix: remove handle-inbound and send-message-direct from bridge for media. MediaHandler (download-media) already handles full pipeline. MediaHandler now sends a localized spinner after user lookup (sendSpinner flag). 2. gemini-1.5-pro → 404: gemini-1.5-pro is deprecated via Google API v1beta. Updated GeminiProvider to use gemini-2.0-flash for both flash and complex (pro) requests. 3. Multilingual deep-dive invitation (EN/ES/PT): action-feedback-standard.md only had FR and WO variants for the APPROFONDIR/SUITE invitation at end of feedback. Added EN, ES, PT — AI was mixing languages for English/Spanish/Portuguese users. 4. InboundHandler [object Object] bug: aiService.tran…5f0a436 -
docs: add Agrombaay and SedapTech as partner use cases in pitch deck
CognxSafeTracka9bacbe -
docs: add full session change log for 2026-05-11/12 security sprint
CognxSafeTrack9decc6a -
docs: add security audit and implementation plan
CognxSafeTrack4c2725c
-
fix(ux): dashboard error state with 15s timeout and retry button
CognxSafeTrack +1: Claude Sonnet 4.6Add fetchError state, Promise.race timeout (15s), and an error screen with AlertTriangle + "Réessayer" button if the API doesn't respond. Prevents the spinner from hanging indefinitely on network failures. Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>34c32dc -
fix(audit): resolve technical debt + UX issues from 2026-05-11 audit
CognxSafeTrack +1: Claude Sonnet 4.6Backend: - Add missing DB indexes on Response.userId and Response.enrollmentId - Add 15s timeout with fallback on AI personalization in pedagogy.ts - Fix race condition in NavigationHandler with atomic $transaction - Fix OnboardingHandler hard reset: use FK cascades, 5-lang confirmation - Change seedDatabase to static import in CommandHandler - Add proper pagination to /enrollments admin endpoint UX/Admin: - Fix responsive grid on dashboard stats (1col mobile → 5col desktop) - Show filename + status label during file upload in ContactsPage - Add success/error toast with import summary on contact CSV/XLSX upload - Add inline form validation with field-level errors in ClientsManagementView - Wire up Copy button on AI-generated messages in ContactsPage Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>9fe2cc7 -
docs: update organisation-onboarding README with 2026-05-11 fixes
CognxSafeTrack +1: Claude Sonnet 4.6- Dashboard: document tier color coding + info modal (ℹ️) - Section 6: add interactive messages fallback + 24h window note - Section 9: add lessons for Contact.language migration, OnboardingHandler double-INSCRIPTION guard, silent interactive failures, default-org-id Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>68eaf84
-
fix(wizard): replace alert() with toast + add tech debt audit doc
CognxSafeTrack +1: Claude Sonnet 4.6Replaces native alert() calls in OnboardingWizard with useToast(). Adds docs/audit_dette_technique_10052026.md with 10 identified debt items (2 critical: token expiry monitoring, Redis singleton). Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>e1ca6ab -
docs: move organisation onboarding doc to dedicated folder
CognxSafeTrack +1: Claude Sonnet 4.6docs/organisation_onboarding.md → docs/organisation-onboarding/README.md Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>eb5905d -
docs: add organisation_onboarding.md — complete WhatsApp setup reference
CognxSafeTrack +1: Claude Sonnet 4.6Consolidates all discoveries from the first multi-tenant org onboarding: two-mode WhatsApp setup (direct config vs Embedded Signup), Meta status architecture (3-call strategy, WABA test limitations), daily limit tiers, env var requirements, and operational checklist for new organisations. Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>15ab9f3
-
feat: backlog P0→P3 — toast system, payments, tenant isolation, feedback handler, i18n parity
CognxSafeTrack +1: Claude Sonnet 4.6P0 — Critical fixes - Fix generate-feedback job silently dropped: register FeedbackHandler in worker index.ts - Wire FeedbackHandler: AI feedback, Day 11 TeamMember extraction, atomicity enforced P0 — Toast system (replace all alert()) - Add useToast hook + ToastContext + Toaster component - Replace every alert() across admin pages with toast.success/error/warning/info - Migrate all raw fetch() in pages to api.upload() / api.get() / api.post() P1 — Type safety - CrmAIAssistant: icon prop any → React.ElementType - useAudioRecorder: add onError callback instead of alert() - api.ts: add upload() method for multipart FormData P1 — Payment gateway - Add payment-gateway.ts: Orange Money + Wave initiation and webhook parsing - Rewrite payments.ts routes: initiate, status, webhook handlers with auto-enrollment on SUCCESS P1 — AI regression tests - Add apps/api/test/regression/ai-gold-standards.test.ts (12 tests, 5 suites) P2 — Visual recruitment (Day 11) - FeedbackHandler extracts TeamMem…6dd9bad
-
deploy: force redeploy with port fix validation
CognxSafeTracka2d334c -
fix: update production port to 7860 for Hugging Face compatibility and add audit report
CognxSafeTrack10211c3
-
feat: implement whatsapp templates management with security hardening, audit logs, and crm integration
CognxSafeTrack0f2f80a -
chore: stabilization, audit fixes and project synchronization
CognxSafeTrack7b0c22b
-
docs: add final audit report for fastify v4
CognxSafeTrack820d280 -
docs: finalize audit report and apply immediate fixes (#1, #10, #16)
CognxSafeTrackb0e801b -
feat: implement bulk whatsapp campaigns with BullMQ and modular activation refactor (isCrmActive/isEdTechActive)
CognxSafeTracke286845 -
feat: centralize AI logic in @repo /ai-sdk, harmonize worker HTTP clients
CognxSafeTrack +1: Claude Sonnet 4.6Architecture refactoring: - Extract all AI providers (OpenAI, Gemini, ProviderRegistry, ffmpeg, search) from apps/api/src/services/ai/ into new packages/ai-sdk package - API's services/ai/index.ts is now a thin wrapper that injects prisma, redis and organization context into the shared AIService - Worker gains @repo/ai-sdk dependency; ai-pedagogy.ts delegates to aiService.generatePersonalizedLesson instead of duplicating logic - New apiClient (Axios, 30s timeout) and whatsappClient replace bare fetch calls in InboundHandler and MediaHandler for consistent error handling - Prisma seed fixed: Tracks now include organizationId for multi-tenant compliance Build: all 8 packages pass pnpm turbo run build from clean state. Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>2849f33
-
chore: finalize Sprint P2 & P3 optimizations, baseline prisma migrations, and update technical audit docs
CognxSafeTrackcfbb685
-
docs: update architecture with deployment cycle (trigger railway redeploy)
CognxSafeTrack35cc40c -
feat: implement WhatsApp setup route and documentation for Embedded Signup
CognxSafeTrack3078897 -
docs: add technical documentation for WhatsApp B2B architecture (force add)
CognxSafeTrack3f3bf16 -
docs: finalize technical debt audit (force add ignored doc)
CognxSafeTrack2fce0d5
-
feat: Premium Onboarding with Meta SDK and Technical Debt resolution
CognxSafeTrack6248bf4
-
chore: major tech debt cleanup v2.1 - Type Safety & Observability
CognxSafeTrack853ee72 -
Refactor: Technical Debt Repayment (Clean Dashboard, Strict Typing, Pino Logging, SQL Migration)
CognxSafeTrackde6a95b
-
docs: Add detailed audio pipeline investigation report
CognxSafeTrack866b42d
-
docs: add audit_production.md + plan_implementation_prod.md; fix admin phone field
CognxSafeTrackf1a06cd -
chore: ignore and remove docs folder
CognxSafeTrackf32bf87 -
feat(module1): integrate the 12-day curriculum in FR/WO with seed data and auto-routing
CognxSafeTrackcd75882 -
docs: add technical audit of the new pedagogical architecture
CognxSafeTrack1f0e6e9 -
feat(whatsapp): implement interactive pedagogy architecture with Voice and Button routing
CognxSafeTrack5746532
-
chore: setup whatsapp-worker for pure JS compilation and add Dockerfile fallback for Railway
CognxSafeTrack8f17184