PD-180 — Dossier de conformité Gate 5 v2¶
Gate : AMBIGUITY¶
Story : PD-180 — Webhooks événements utilisateur¶
Date : 2026-03-07¶
Itération : v2¶
1. Résolution des écarts v1¶
| ECT v1 | Statut v2 |
|---|---|
| ECT-01 (BLOQ) Rate limit 429 + checkAndIncrement | RÉSOLU — checkAndIncrementN(N) post-fanout, delay BullMQ au lieu de 429 |
| ECT-02 (BLOQ) Atomicité DB+BullMQ | RÉSOLU — pattern outbox : INSERT en TX, enqueue post-commit |
| ECT-03 (BLOQ) Replay scope à 1 webhook | RÉSOLU — route /webhooks/replay/:eventId, broadcast vers tous ACTIVE abonnés |
| ECT-04 (MAJ) Observabilité | RÉSOLU — colonnes signed_payload, signature_header, secret_read_at, resolved_ip documentées |
| ECT-05 (MAJ) Code contracts non ancrés | RÉSOLU — note ajoutée distinguant invariants spec (INV-XX) des conventions projet |
| ECT-06 (MAJ) ESM/CJS | RÉSOLU — CommonJS documenté (coherent avec NestJS existant) |
| ECT-07 (MAJ) Transport tenantId | RÉSOLU — format EventEmitter2 documenté avec tenantId obligatoire |
| ECT-08 (MIN) Limite metadata | RÉSOLU — validation 4096 bytes dans DTO documentée |
| ECT-09 (MIN) Section contraintes techniques | RÉSOLU — section §9.8 ajoutée |
| ECT-10 (MIN) Dépendances inter-PD | RÉSOLU — toutes listées avec statut DONE |
| ECT-11 (MIN) Framework de test | RÉSOLU — Jest documenté |
| ECT-12 (MIN) Variables CI | RÉSOLU — DATABASE_URL, REDIS_URL, NODE_ENV=test |
2. Écarts résiduels v2¶
BLOQUANTS (0)¶
Aucun.
MAJEURS (0)¶
Aucun.
MINEURS (2)¶
| ID | Type | Description | Source |
|---|---|---|---|
| RES-01 | Hypothèse | Le delay calculé pour les intentions excédentaires n'est pas formalisé (formule exacte). | Déduction ECT-01 |
| RES-02 | Ambiguïté | La colonne signed_payload pourrait excéder les limites PostgreSQL pour les gros payloads metadata. | Déduction ECT-04 |
3. Scoring par critère¶
| Critère | Écarts assignés | Score |
|---|---|---|
| feasibility | — | 10.0 |
| coverage | RES-02 (MIN) | 10 - 0.25 = 9.75 |
| risk_mitigation | RES-01 (MIN) | 10 - 0.25 = 9.75 |
| coherence | — | 10.0 |
Moyenne : (10.0 + 9.75 + 9.75 + 10.0) / 4 = 9.88
4. Convergence¶
- v1 mean: 7.19
- v2 mean: 9.88
- Delta: +2.69 (amélioration majeure)
5. Verdict¶
- Moyenne 9.88 >= 7 : OK
- Tous scores >= 8 : OK (10.0, 9.75, 9.75, 10.0)
- Verdict : GO