[DTP-Worker] Sprint 2 · Publiciste scaffold (parser faisabilité → JSON + generator + gate)
Livrable Publiciste · Sprint 2 · Semaine 2 (seul module net-neuf · chemin critique · GAP_ANALYSIS §3.13). Cible portage VPS : otoia/capabilities/publiciste.py. - lib/parser.py : data_room/PXX/ (template v1.0) → projet dict conforme au contrat projets_master.schema.json (livré S1). Mapping colonnes par en-tête, parsing montants USD/DOP robuste. Anti-invention #6 : rétrogradation défensive « en_developpement » si prix USD manquant ; absent → null (jamais 0/inventé). - lib/validator.py : validateur JSON-Schema draft-07 (sous-ensemble) ZÉRO dépendance pip (runner Gitea sans pip). Oracle jsonschema en test si présent. - lib/generator.py + template + branding : rendu HTML luxury #4 (dark+doré, Fraunces + Cormorant Garamond) ; sans prix → « Prochainement · Détails à venir ». - publiciste.py : CLI parse/validate/generate/run. - fixtures/ : données SYNTHÉTIQUES de test (jamais publiées) P01 complète + P02 incomplète. - tests/ : 23 tests unittest (stdlib) verts. - CI : job publiciste-tests ajouté au gate (.gitea/workflows/ci.yml · Gitea #2). Vérifs (en-repo, sans VPS) : 23/23 tests verts · gate CI local vert (guard/JSON/ docs) · pipeline CLI produit un master conforme au schéma. Auto-score 4Big 95/100. Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
This commit is contained in:
@@ -0,0 +1,83 @@
|
||||
# Publiciste Agent — scaffold (Sprint 2)
|
||||
|
||||
Maintient automatiquement le site public `vente.otov7.com` **à partir des
|
||||
faisabilités canoniques** (`data_room/PXX/`, template v1.0), sans édition manuelle.
|
||||
Cible de portage sur le VPS : `otoia/capabilities/publiciste.py`
|
||||
(voir [`../../03_agents/publiciste/AGENT.md`](../../03_agents/publiciste/AGENT.md)
|
||||
et [`../GAP_ANALYSIS_SPRINT1.md`](../GAP_ANALYSIS_SPRINT1.md) §3.13 — seul module
|
||||
net-neuf, chemin critique).
|
||||
|
||||
## Pipeline
|
||||
|
||||
```
|
||||
data_room/PXX/ ──► lib/parser.py ──► projets_master.json ──► lib/generator.py ──► index.html
|
||||
(faisabilité) (extraction) (contrat schéma) (rendu luxury) (site public)
|
||||
```
|
||||
|
||||
Le contrat `projets_master.json` est défini par
|
||||
[`../faisabilite/projets_master.schema.json`](../faisabilite/projets_master.schema.json)
|
||||
(livré au Sprint 1). Le versioning faisabilité par
|
||||
[`../faisabilite/version.schema.json`](../faisabilite/version.schema.json).
|
||||
|
||||
## État par rapport au calendrier AGENT.md
|
||||
|
||||
| Semaine | Livrable | Statut ici |
|
||||
|---|---|---|
|
||||
| **S2** | Setup base + **parser faisabilité → JSON** | ✅ `lib/parser.py` + validation schéma |
|
||||
| S3 | Générateur HTML → site | ✅ aperçu `lib/generator.py` (rendu luxury #4) |
|
||||
| S4 | Triggers systemd + inotify | ☐ (exécution VPS — hors périmètre worker) |
|
||||
| S5 | Notifications WhatsApp Michel | ☐ (VPS) |
|
||||
| S6 | Multilingue FR/EN/ES auto | ☐ (FR extrait ; EN/ES à venir) |
|
||||
| S7 | Tests + validation P01-P09 | 🟡 tests sur fixtures synthétiques (données réelles VPS) |
|
||||
| S8 | Production | ☐ (VPS) |
|
||||
|
||||
## Composants
|
||||
|
||||
| Fichier | Rôle |
|
||||
|---|---|
|
||||
| `publiciste.py` | Orchestrateur CLI (`parse` / `validate` / `generate` / `run`) |
|
||||
| `lib/parser.py` | `data_room/PXX/` → dict projet (contrat schéma) · **anti-invention #6** |
|
||||
| `lib/validator.py` | Validateur JSON-Schema draft-07 (sous-ensemble) · **zéro dépendance pip** |
|
||||
| `lib/generator.py` | `projets_master.json` → HTML (marque luxury #4) |
|
||||
| `lib/branding.py` | Tokens de marque (source unique · CLAUDE.md #4) |
|
||||
| `templates/site_public.html.tmpl` | Gabarit dark+doré (Fraunces + Cormorant Garamond) |
|
||||
| `fixtures/` | Données **synthétiques** de test (⚠️ jamais publiées — cf. `fixtures/README.md`) |
|
||||
| `tests/test_publiciste.py` | Suite `unittest` (parser, schéma, generator) |
|
||||
|
||||
## Règles anti-invention appliquées (CLAUDE.md #6)
|
||||
|
||||
- Le statut publié dérive de `_META/version.json` : `complete → disponible`, sinon
|
||||
`en_developpement`.
|
||||
- **Rétrogradation défensive** : un projet n'est « disponible » que si TOUTES ses
|
||||
typologies ont un prix USD numérique ; sinon → « En développement · Prochainement ».
|
||||
- Cellule vide / « non défini » / placeholder `{{…}}` → `null` (jamais `0`, jamais
|
||||
une valeur inventée).
|
||||
- Rendus : uniquement ceux référencés dans la faisabilité (❌ IA générique).
|
||||
|
||||
## Utilisation
|
||||
|
||||
```bash
|
||||
# depuis 05_deliverables_mvp/publiciste/
|
||||
|
||||
# Parser une data_room → projets_master.json (validé contre le schéma)
|
||||
python3 publiciste.py parse fixtures/data_room -o build/projets_master.json
|
||||
|
||||
# Générer le site depuis un master validé
|
||||
python3 publiciste.py generate build/projets_master.json -o build/index.html
|
||||
|
||||
# Pipeline complet
|
||||
python3 publiciste.py run fixtures/data_room -o build/
|
||||
|
||||
# Tests
|
||||
python3 -m unittest discover -s tests -v
|
||||
```
|
||||
|
||||
> ⚠️ Ce worker n'écrit jamais sur le VPS. Le déploiement réel (copie vers
|
||||
> `/opt/oto/sites/vente/`, cache-bust Cloudflare, notification WhatsApp) est un
|
||||
> livrable ultérieur exécuté côté serveur par l'agent (Semaines 4-5).
|
||||
|
||||
## Auto-score 4Big du livrable : **95/100**
|
||||
|
||||
_Réserve −5_ : exécution contre les **données réelles** `data_room/` (VPS, hors
|
||||
périmètre) différée ; triggers systemd/inotify + notifications WhatsApp = livrables
|
||||
Semaines 4-5 côté serveur ; génération EN/ES = Semaine 6.
|
||||
Reference in New Issue
Block a user