From 8920547a98af7bb19cbc66a35688b08e03a605e2 Mon Sep 17 00:00:00 2001 From: Gabriel Radureau Date: Sat, 11 Jul 2026 14:39:41 +0200 Subject: [PATCH] =?UTF-8?q?docs(prd):=20D4=20leaning=20=E2=80=94=20Qonto?= =?UTF-8?q?=20as=20the=20plateforme=20agr=C3=A9=C3=A9e=20(ex-PDP)?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Operator direction: Qonto is the capital-deposit bank, a DGFiP-registered PA with e-invoicing included in every plan, and the fleet's richest existing API integration. POC-6 rewritten from shortlist to validation spike (reception + business-API pull + GED archival + 2027 e-reporting path for the KM export invoices); C12 residual now names the vendor- concentration trade-off; terminology refreshed PDP -> PA (renamed by the administration in July 2025); 2027-09 milestone clarified (e-reporting for export invoices; emission only if a French B2B client arrives). Co-Authored-By: Claude Fable 5 --- vibe/PRD/ai-back-office/README.md | 6 +++--- vibe/PRD/ai-back-office/agent-architecture.md | 2 +- vibe/PRD/ai-back-office/challenges.md | 6 +++--- vibe/PRD/ai-back-office/poc-plan.md | 6 +++--- vibe/PRD/ai-back-office/task-inventory.md | 4 ++-- 5 files changed, 12 insertions(+), 12 deletions(-) diff --git a/vibe/PRD/ai-back-office/README.md b/vibe/PRD/ai-back-office/README.md index ee444b4..7e71186 100644 --- a/vibe/PRD/ai-back-office/README.md +++ b/vibe/PRD/ai-back-office/README.md @@ -121,10 +121,10 @@ flowchart TB | Date | Obligation | Impact here | | --- | --- | --- | -| **2026-09-01** | E-invoice **reception** mandatory for all companies | Inbound supplier pipeline gains a structured source: a PDP (*plateforme de dématérialisation partenaire* — accredited e-invoicing platform); PDP choice + Dolibarr wiring needed *before* this date. | +| **2026-09-01** | E-invoice **reception** mandatory for all companies | Inbound supplier pipeline gains a structured source: a PA (*plateforme agréée*, ex-PDP — DGFiP-accredited e-invoicing platform); **leaning Qonto** ([D4](agent-architecture.md#open-decisions)) — reception wired and verified *before* this date. | | **2026-12** | TVA acompte de décembre (réel simplifié) | Calendar + preparation atom (expected ≈ 0 € while in TVA credit — verify, don't assume). | | **2027-01-01** | Régime réel simplifié **supprimé** → quarterly **CA3** | TVA preparation atom must produce quarterly CA3 sheets from 2027-Q1; last CA12 (FY 2026) filed ~May 2027. | -| **2027-09-01** | E-invoice **emission** (PME) + **e-reporting** of international transactions | Outbound invoices to the US client must flow through a PDP; emission pipeline + e-reporting atom. | +| **2027-09-01** | E-invoice **emission** (PME) + **e-reporting** of international transactions | The KM export invoices fall under **e-reporting**: their transaction data must reach the DGFiP via the PA; true e-invoice *emission* applies only when a French B2B client arrives — build readiness for both. | ## Success criteria @@ -142,7 +142,7 @@ flowchart TB | --- | --- | --- | | **0 — Foundations** | Read skills, sandbox + promote gate, backups, snapshots, bank reco, email ingest, Telegram gateway MVP | ✅ shipped pre-PRD (see [STATUS](STATUS.md)) | | **1 — Flagship pipeline** | POC-1 supplier-invoice end-to-end + POC-5 routing bench | proves A2 write loop | -| **2 — Urgent compliance** | E-invoicing reception readiness (PDP choice, ADR, Dolibarr wiring) | **hard deadline 2026-09-01** | +| **2 — Urgent compliance** | E-invoicing reception readiness (PA validation — leaning Qonto, ADR, pipeline wiring) | **hard deadline 2026-09-01** | | **3 — Standing fleet** | POC-2 Pi sentinel, scheduler/queue, digest + approval cards | proves 24/7 + degraded modes | | **4 — Money loops** | POC-3 reconciliation + payment recording, dunning drafts, cash report | closes the bank↔ERP loop | | **5 — Fiscal autopilot** | POC-4 TVA dry-runs (acomptes, CA12 2026, CA3-2027 simulation), compliance calendar | proves €-parity before 2027 regime switch | diff --git a/vibe/PRD/ai-back-office/agent-architecture.md b/vibe/PRD/ai-back-office/agent-architecture.md index ae82fe7..3c30c84 100644 --- a/vibe/PRD/ai-back-office/agent-architecture.md +++ b/vibe/PRD/ai-back-office/agent-architecture.md @@ -149,7 +149,7 @@ To be settled by POC evidence, each closing with a short ADR: | D1 | Work queue | telegram-gateway's planned Postgres durable queue (**leaning** — already roadmapped, transactional, one less system) vs. flat files in git vs. Redis | | D2 | Orchestration runtime | Claude Agent SDK headless for cluster-triggered jobs + **hermes** for M4-side lanes (**leaning** — hermes already runs skills + cron there) vs. bespoke TS orchestrator (erp `test/` Deno codebase) vs. pure CronJobs + scripts | | D3 | KM monthly invoice firing | enable Dolibarr template auto-fire (`frequency>0`) vs. agent-fired via sandbox+promote (**leaning** — keeps the gate + mention audit in-line) | -| D4 | PDP (e-invoicing platform) | shortlist + Dolibarr 22 module compatibility test on sandbox — **must close before 2026-09-01** ([C12](challenges.md#c12--e-invoicing-reform-unknowns)) | +| D4 | PA — e-invoicing platform (*plateforme agréée*, ex-PDP) | **Leaning: Qonto** (operator direction, 2026-07 — the capital-deposit bank, DGFiP-registered PA, e-invoicing included in every plan, and the fleet's richest existing API integration); POC-6 validates reception + API pull before the ADR — **must close before 2026-09-01** ([C12](challenges.md#c12--e-invoicing-reform-unknowns)) | | D5 | OCR provider for scanned docs | Mistral OCR (EU cloud) vs. local vision model on M4 vs. Tesseract baseline | | D6 | Pi inference serving | llama.cpp server vs. Ollama on arm64, resource limits, node pinning ([C5](challenges.md#c5--slm-capability-ceiling-on-pi-hardware)) | | D7 | Cluster↔vault access | git clone/pull of the SecondBrain remote (**leaning** — the Gitea remote exists, offline-friendly, reviewable) vs. tunneled Obsidian REST API (M4-only today) vs. keeping vault access M4-exclusive | diff --git a/vibe/PRD/ai-back-office/challenges.md b/vibe/PRD/ai-back-office/challenges.md index f373828..9f56fc8 100644 --- a/vibe/PRD/ai-back-office/challenges.md +++ b/vibe/PRD/ai-back-office/challenges.md @@ -77,6 +77,6 @@ Each challenge states what breaks, the mitigation strategy, and the **residual** ## C12 — E-invoicing reform unknowns -**Breaks:** 2026-09-01 arrives and Arcodange cannot receive e-invoices; or the PDP/formats chosen fight the pipeline instead of feeding it; 2027-09-01 adds emission + e-reporting for the US-client invoices with no plan. -**Strategy:** a dedicated discovery spike **now** ([POC-6](poc-plan.md#poc-6--e-invoicing-readiness-spike), phase 2 of the [roadmap](README.md#phased-roadmap)): PDP shortlist, Dolibarr 22 module compatibility on the sandbox, format handling (Factur-X/UBL/CII) — closed by an ADR before the deadline. Upside to capture: PDP-received invoices are **structured data** — T02 extraction gets *easier* and more reliable for FR suppliers; the mail-scraping lane remains for foreign/legacy senders. -**Residual:** regulatory calendar may still move (it has before) — tracked by T12; building reception readiness early costs little even if deadlines slip. +**Breaks:** 2026-09-01 arrives and Arcodange cannot receive e-invoices; or the PA/formats chosen fight the pipeline instead of feeding it; 2027-09-01 adds **e-reporting** for the US-client export invoices (and emission-readiness for any future French B2B client) with no plan. +**Strategy:** a dedicated validation spike **now** ([POC-6](poc-plan.md#poc-6--e-invoicing-readiness-spike), phase 2 of the [roadmap](README.md#phased-roadmap)): **Qonto as the PA** (*plateforme agréée*, ex-PDP) — operator direction: already the capital-deposit bank, a DGFiP-registered PA with e-invoicing included in every plan, and the fleet's richest existing API integration; POC-6 verifies reception + API pull on real data, format handling (Factur-X/UBL/CII), and an ADR records the decision before the deadline. Upside to capture: PA-received invoices are **structured data** — T02 extraction gets *easier* and more reliable for FR suppliers; the mail-scraping lane remains for foreign/legacy senders. +**Residual:** vendor concentration — bank, PA, and (from 2027) the e-reporting conduit in one provider; accepted because every original lands in the GED and the DGFiP-registered list keeps the exit open (switching PA is configuration, not archaeology). The regulatory calendar may still move (it has before) — tracked by T12. diff --git a/vibe/PRD/ai-back-office/poc-plan.md b/vibe/PRD/ai-back-office/poc-plan.md index cf1c5d3..db912f4 100644 --- a/vibe/PRD/ai-back-office/poc-plan.md +++ b/vibe/PRD/ai-back-office/poc-plan.md @@ -59,9 +59,9 @@ POCs are **real implementations against real data** (the live mailbox, the live *Phase 2 — hard deadline 2026-09-01 · effort M.* **Proves:** Arcodange can receive e-invoices on day one; closes [D4](agent-architecture.md#open-decisions) with an ADR ([C12](challenges.md#c12--e-invoicing-reform-unknowns)). -**Build:** shortlist of PDPs (*plateformes de dématérialisation partenaires* — cost, API quality, Dolibarr support); test Dolibarr 22 e-invoicing module(s) on the **sandbox**; parse a real Factur-X/UBL sample through T02's schema (structured lane). -**Exit criteria:** a chosen PDP with reception verified (a test e-invoice reaches Arcodange and lands in the pipeline) before 2026-09-01; ADR merged; 2027 emission/e-reporting requirements captured as backlog fiches with owners and dates. -**Fallback if failed:** minimum-compliance manual reception via the chosen PDP's web UI while the pipeline lane matures. +**Build:** validate **Qonto as the PA** (*plateforme agréée*, ex-PDP — operator direction: the capital-deposit bank, DGFiP-registered, e-invoicing included in every plan): activate the e-invoicing address, receive a real or test e-invoice, **pull it through the business API** (the fleet already authenticates there) into T02's structured schema; archive the original in the GED (the PA is a conduit, never the archive); map the 2027 path — Dolibarr stays the invoicing system of record, so establish how e-reporting data for the KM export invoices reaches Qonto (API push vs. manual) before it becomes mandatory. +**Exit criteria:** reception verified end-to-end (supplier e-invoice → Qonto → API pull → validated draft in the pipeline) before 2026-09-01; ADR merged recording Qonto as the PA; 2027 e-reporting requirements captured as backlog fiches with owners and dates. +**Fallback if failed:** any other DGFiP-registered PA (138 exist as of 2026-06) — switching stays cheap because originals live in the GED, not at the PA; minimum-compliance manual reception via the Qonto UI while the API lane matures. ## Challenge coverage diff --git a/vibe/PRD/ai-back-office/task-inventory.md b/vibe/PRD/ai-back-office/task-inventory.md index c8ec5a8..714b69c 100644 --- a/vibe/PRD/ai-back-office/task-inventory.md +++ b/vibe/PRD/ai-back-office/task-inventory.md @@ -55,7 +55,7 @@ Backlog (not yet specified): [see bottom](#backlog--deferred). ### T02 — Supplier invoice extraction - **Trigger:** a `supplier-invoice` queue item from T01 (or a PDF dropped manually). -- **Inputs:** message + PDF attachments (Zoho download); from 2026-09, e-invoices received via the PDP (structured CII/UBL/Factur-X — see [challenges C12](challenges.md#c12--e-invoicing-reform-unknowns)). +- **Inputs:** message + PDF attachments (Zoho download); from 2026-09, e-invoices received via the PA (*plateforme agréée*, ex-PDP; leaning Qonto, pulled through the business API — structured CII/UBL/Factur-X, see [challenges C12](challenges.md#c12--e-invoicing-reform-unknowns)). - **Mode opératoire:** 1. [AGENT] Download attachments; compute file hash (dedupe + GED key). 2. [AGENT] Text layer via `pdftotext`; if empty/scanned, OCR fallback (Mistral OCR or local vision — POC decides). @@ -107,7 +107,7 @@ Backlog (not yet specified): [see bottom](#backlog--deferred). 2. [AGENT] Generate the month's invoice (sandbox rehearsal → gate → prod), with the France↔US specifics: autoliquidation Art. 259-1° CGI (TVA collectée = 0, bucket E2), USD/EUR handling as contracted. 3. [AGENT] Run the mandatory-mention audit on the produced PDF (`dolibarr-invoice-audit`: SIRET, RCS, TVA intracom, L.441-10 penalties, 40 € indemnity, etc.). 4. [HUMAN] Approves the send; [AGENT] emails the invoice to the client contact (allowlisted recipient) and records the expected due date per the contracted payment cycle. - 5. From 2027-09: [AGENT] submits the e-reporting data for this international transaction via the PDP ([challenges C12](challenges.md#c12--e-invoicing-reform-unknowns)). + 5. From 2027-09: [AGENT] submits the e-reporting data for this international transaction via the PA (leaning Qonto — [challenges C12](challenges.md#c12--e-invoicing-reform-unknowns)). - **Guardrails:** outbound email is always human-gated; the invoice number sequence is owned by Dolibarr (never fabricated); a failed mention-audit blocks the send. - **Today:** template inspection + invoice audit are A3-eligible (read, on demand); issuance is manual in the UI. - **Target:** **A2**; Claude tier.