feat(translation): quality pipeline overhaul + new features (audit 2026-08-29)
All checks were successful
Deploy to Production / Build and Deploy (push) Successful in 2m20s

Translation quality & format preservation:
- Word: merge adjacent same-format runs into one unit (sentence-level
  coherence like inline-tag handling); translate comments/balloons;
  dedupe textbox collection (was translated twice); RTL no longer
  overrides center/justify alignment; CJK/Arabic font hints (eastAsia/cs)
- PPTX: chart translations now actually reach the output file
  (ChartPart.blob is read-only — rewrite chart XML in the saved ZIP);
  CJK typeface hints (a:ea)
- Excel: sheet renames no longer break references — rewrite cell
  formulas (3D/quoted), defined names, data validations, cond. formats
- PDF: bold/italic honored (hebo/heit/hebi); table cells never merge;
  unchanged blocks left untouched (typography preserved, fixes duplicate
  hyperlinks); attempted/changed stats + route gate now cover PDF;
  CJK font paths; scanned PDFs via Mistral OCR (detection + admin settings)

Features:
- formality param (formal/informal) + automatic regional-variant prompts
- output_mode=bilingual docx (source above translation)
- per-user translation memory on Redis (falls back to LRU), context-hashed
- QA report + 0-100 confidence score in job status; L0 on by default
- OpenAI-compatible providers: whole chunk in ONE numbered-JSON request
  (~15x fewer calls) with per-item fallback; base prompt always present
  (custom prompt no longer replaces translation instructions)

Infra & marketing alignment:
- plan-based engine gating + vision gating (closes paid-engine leak);
  /providers/available filtered per plan; 107 languages exposed
- zh-CN/zh-TW validation fixed; libmagic disabled on Windows (native crash)
- admin: Mistral OCR settings + engine status dashboard; httpx<0.28 pin
  (TestClient breakage); Prometheus test fixture fixed
- marketing docs aligned with code (PDF+OCR, retention, engines, pricing)
- security: .env.ionos/.env.production/provider_settings.json removed

Tests: 1173 passed / 0 failed (6 network tests deselected: free Google
endpoint temporarily blocked from this machine)
This commit is contained in:
2026-08-29 18:38:09 +02:00
parent 992f13d53c
commit 526c87348f
87 changed files with 6996 additions and 1024 deletions

72
docs/marketing/kpis.md Normal file
View File

@@ -0,0 +1,72 @@
# Suivi des KPIs — Définitions & Cadence
> Document de mesure. Source de vérité pour le reporting marketing.
> Mis à jour : 2026-08-29
## 1. Stack de mesure (déployée)
| Outil | Rôle | Où |
|---|---|---|
| **Vercel Analytics** | Pages, événements, referrers, heatmaps | `office-translator-landing-page/app/layout.tsx` |
| **Événements custom** | Funnels précis (voir §2) | `track(...)` dans les composants |
| **Endpoint waitlist** | Source de vérité des e-mails | `GET /api/v1/waitlist/count` |
| **BDD utilisateurs** | Inscriptions, plans, quotas | Backend (Postgres) |
| **Journal de jobs** | Documents traduits, temps de traitement | Backend |
| **Stripe** | MRR, abonnements, churn | Portail Stripe |
| **`/health` + Grafana** | Performance système/applicative | Backend |
## 2. Événements trackés (Vercel Analytics)
| Événement | Propriétés | Déclenché par | Funnel |
|---|---|---|---|
| `translation_started` | `engine`, `source`, `target` | Bouton « Translate Document » | Activation |
| `pricing_cta_click` | `plan` | CTA d'un plan | Considération |
| `waitlist_joined` | `interest` | Inscription waitlist réussie | Capture |
| `waitlist_error` | `status` | Inscription waitlist en échec | Capture (santé) |
**Pages clés à surveiller** : `/` (hero, pricing, faq, waitlist), `/dashboard` (activation), `/admin` (ops).
## 3. Définitions des KPIs
| KPI | Définition | Source | Fréquence |
|---|---|---|---|
| Visiteurs uniques | Sessions sur `/` (30 j glissants) | Vercel Analytics | Hebdo |
| Taux d'activation | `translation_started` / visiteurs uniques | Vercel Analytics | Hebdo |
| E-mails waitlist | `count` (dédoublonné) | `/api/v1/waitlist/count` | Quotidien |
| Taux de capture | `waitlist_joined` / visiteurs uniques | Vercel Analytics | Hebdo |
| Inscriptions | Nouveaux comptes (tous plans) | BDD utilisateurs | Hebdo |
| Documents traduits | Jobs terminés | Journal de jobs | Hebdo |
| Taux de conversion payant | Abonnements payants / inscriptions | Stripe + BDD | Mensuel |
| MRR | Revenu mensuel récurrent | Stripe | Mensuel |
| Churn mensuel | Abonnements perdus / début de période | Stripe | Mensuel |
| CAC (Ads) | Dépense Ads / nouveaux payants (30 j) | Google Ads + Stripe | Mensuel |
| NPS | Enquête post-traduction (010) | Enquête | Mensuel |
| Disponibilité | `uptime` de `/health` | Grafana | Continu |
## 4. Cibles (alignées sur MARKETING_PLAN.md §6)
| KPI | M1 | M3 |
|---|---|---|
| Visiteurs uniques | 5 000 | 25 000 |
| E-mails waitlist | 150 | 1 500 |
| Inscriptions | 200 | 1 500 |
| Documents traduits | 500 | 5 000 |
| Conversion visite→inscription | 2 % | 4 % |
| NPS | > 40 | > 50 |
| MRR | — | ~300 abonnements payants |
| CAC (Ads) | — | < 3× marge mensuelle (plan d'entrée) |
## 5. Rituels
- **Hebdo (lun, 30 min)** : tableau de bord Vercel + compteur waitlist + inscriptions. Anomalie > 2 σ = ticket.
- **Mensuel (J+2, 1 h)** : MRR, churn, CAC, NPS. Mise à jour de ce doc + de `MARKETING_PLAN.md` si écart > 20 % vs cible.
- **Sprint (2 sem.)** : A/B sur le pricing et le hero ; décision sur Google Ads (maintien/stop) à la semaine 5.
## 6. Alertes
| Condition | Action |
|---|---|
| `waitlist_error` > 5 % des tentatives | Investiguer `POST /api/v1/waitlist` (CORS, prod) |
| Disponibilité `/health` < 99,5 % sur 24 h | Pager ops, consulter `DISASTER_RECOVERY.md` |
| Churn > 10 % / mois | Analyse des raisons de sortie, offre de rétention |
| CAC > 3× marge (Ads) | Stopper la campagne, revenir au SEO/partenariats |