New PRD tree vibe/PRD/ai-back-office/ (hub + 6 leaves + STATUS): task inventory T01-T16 with mode operatoire, atom/contract architecture on the ADR-0003 write gate, four-tier model fleet (Claude/Mistral/M4/Pi), 12 challenges with mitigations, POC plan with exit criteria, QA strategy with autonomy promotion gates. Index row + bidirectional backlinks (erp guidebook, safe-prod PRD). Co-Authored-By: Claude Fable 5 <[email protected]>
22 KiB
22 KiB
vibe > PRD > AI back-office > Task inventory
Task inventory — the enumerated back-office
Status: In design Last Updated: 2026-07-11 Up: AI back-office hub Related: Agent architecture · Model fleet · QA strategy
Every recurring admin/accounting task, with its mode opératoire. Steps carry the runbook markers: [AGENT] = safe for an agent at the stated autonomy, [HUMAN] = stays human (approval, signature, or money). "Today" names the existing tooling (skills live in the erp repo under .claude/skills/, wrapped by bin/arcodange). Autonomy levels are defined in the hub.
Overview
| ID | Task | Cadence / trigger | Today | Target | Primary tier |
|---|---|---|---|---|---|
| T01 | Mailbox triage & routing | every 30 min | manual + on-demand listing | A3 | Pi |
| T02 | Supplier invoice extraction | per T01 item | pdftotext heuristics | A2 | M4 + Mistral |
| T03 | Supplier invoice recording + GED | per validated T02 draft | sandbox-write + promote (manual) | A2 | Claude |
| T04 | Thirdparty creation & completeness | per new party / monthly sweep | audit skill (read) | A2 | Claude |
| T05 | Client invoice issuance (monthly) | 1st of month | template fired by hand in UI | A2 | Claude |
| T06 | Receivables watch & dunning | weekly | payments-state skill (read) | A1→A2 | Claude |
| T07 | Bank reconciliation | weekly | bank-reco skill, on demand | A3 (report) | Claude |
| T08 | Payment recording | per reco finding | sandbox-write + promote (manual) | A2 | Claude |
| T09 | Cash position & runway report | monthly | balances workflow (read) | A3 | M4 |
| T10 | TVA preparation | fiscal calendar | tva-summary skill (read) | A1 (by design) | Claude |
| T11 | Compliance calendar & reminders | daily check | human memory + DGFiP mails | A3 (reminders) | Pi |
| T12 | Regulatory watch | quarterly + event | ad-hoc research | A1 | Claude |
| T13 | ERP snapshot & drift detection | daily + around writes | snapshot skill, on demand | A3 | cluster (no LLM) |
| T14 | Backup & restore verification | daily / monthly drill | CronJob live; restore manual | A3 | cluster (no LLM) |
| T15 | Monthly coherence audit | 1st of month | skills exist, composed by hand | A3 | Claude |
| T16 | Document filing & retention | per document | ad-hoc | A2 | M4 |
Backlog (not yet specified): see bottom.
Inbound — mail & documents
T01 — Mailbox triage & routing
- Trigger: cron, every 30 min, 24/7.
- Inputs: unread messages in
[email protected],/Inbox/books(aliasbooks@, supplier invoices),/bureaux(aliasbureaux@, administration: URSSAF, the SIE/DGFiP tax office, PortailPro), via the Zoho Mail read-only OAuth API (arcodange-email-ingestskill). - Mode opératoire:
- [AGENT] Poll new message headers + snippets since the last high-water mark.
- [AGENT] Classify each into
{supplier-invoice, bank-notice, government-admin, client, other}with a schema-constrained output (class + confidence + one-line reason). - [AGENT] Enqueue
supplier-invoiceitems for T02; taggovernment-adminitems for the daily digest (and T11 if a deadline is detected); surfacebank-noticeitems in the digest as context for the next T07 run; flagclientmail for human reply (never auto-answered); leaveotheruntouched. - [AGENT] Below the confidence threshold or on classifier disagreement: park in the review queue instead of guessing.
- [HUMAN] Reads the daily digest; reclassifications feed the golden set.
- Outputs: queue items (typed), digest lines, classification journal.
- Guardrails: read-only mailbox scopes; a classification is data, not an action — the queues downstream own actions; every misclassification is recoverable (nothing is deleted or moved).
- Today:
arcodange-email-ingestlists candidates on demand; no standing watcher. - Target: A3 on Pi tier (this is the flagship SLM task: small closed class set, constrained decoding, low stakes); M4/Mistral fallback when the Pi tier is down or unsure.
T02 — Supplier invoice extraction
- Trigger: a
supplier-invoicequeue 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).
- Mode opératoire:
- [AGENT] Download attachments; compute file hash (dedupe + GED key).
- [AGENT] Text layer via
pdftotext; if empty/scanned, OCR fallback (Mistral OCR or local vision — POC decides). - [AGENT] Extract to the invoice schema: supplier identity (+ SIREN/TVA intra if present), invoice ref, issue/due dates, currency, per-rate HT/TVA amounts, TTC, IBAN, service-vs-goods, period covered.
- [AGENT] Dual extraction on critical fields (amounts, IBAN, ref, dates): two independent models (M4 local + Mistral) must agree exactly; disagreement → escalate to Claude tier; still ambiguous → review queue.
- [AGENT] Deterministic validation:
HT + TVA = TTC(±0.01 €), rate ∈ {0, 2.1, 5.5, 10, 20} or explicit reverse-charge, SIREN checksum, IBAN mod-97, dates plausible, duplicate check against existingref_supplier+ amount + supplier. - [AGENT] Emit a draft entry (validated JSON + confidence + source hash) for T03.
- Outputs: draft supplier-invoice entry; quarantine item on any validation failure.
- Guardrails: extraction atoms run with zero credentials and zero action tools (see injection defenses); document content is data, never instructions; no field is ever "corrected" by the model to make arithmetic pass — mismatch means quarantine.
- Today: heuristic first-line/regex extraction in
arcodange-email-ingest(draft JSON for manual UI entry). - Target: A2 (feeds the gated write); M4 + Mistral tiers, Claude escalation.
T03 — Supplier invoice recording
- Trigger: a validated draft from T02.
- Inputs: draft entry; thirdparty check result from T04.
- Mode opératoire:
- [AGENT] Resolve or create the supplier fiche (T04) — lookup by name/SIREN via business-key (
#thirdparty:...), never by guessed id. - [AGENT] Assemble a write manifest (thirdparty? + supplier invoice with lines + correct VAT treatment per the fiscal profile: FR 20 % déductible, intra-EU reverse charge, etc.).
- [AGENT] Rehearse on the sandbox (
dolibarr-sandbox-write), re-read what was created, assert it matches the draft (predicted-delta check). - [AGENT] Surface a Telegram approval card: supplier, ref, amounts, VAT bucket, PDF link, sandbox diff.
- [HUMAN] One-tap approve (or edit/reject with a reason — reasons feed the golden set).
- [HUMAN+AGENT] Gated promote to prod (
arcodange promote apply --target prod, env-confirmed, prod key never stored) — per ADR 0003. - [AGENT] Attach the source PDF to the prod supplier invoice in the GED (gestion électronique de documents — Dolibarr's attached-files store), verify by re-read + snapshot delta; journal the run.
- [AGENT] Resolve or create the supplier fiche (T04) — lookup by name/SIREN via business-key (
- Outputs: recorded + documented supplier invoice in prod; journal entry; GED attachment.
- Guardrails: idempotency key = (supplier,
ref_supplier, TTC) — a replay can never double-record; the sandbox host-guard structurally refuses prod; validation of the recorded state, not just the request. - Today: all write machinery exists and is proven (
dolibarr-sandbox-write, promote plan/apply, business-key lookup); it is driven by hand from Claude Code sessions. - Target: A2, Claude tier assembling/verifying, human approving via Telegram.
T04 — Thirdparty creation & completeness
- Trigger: unknown party in T02/T03; plus a monthly completeness sweep.
- Mode opératoire:
- [AGENT] Country-aware completeness audit (
dolibarr-thirdparty-completeness): FR → SIREN+SIRET (+ TVA intra if VAT-registered), EU → TVA intra, extra-EU → national tax id. - [AGENT] For a new supplier/client: gather identifiers from the invoice + public registries; assemble the fiche creation as part of the T03 manifest.
- [AGENT] For gaps on existing fiches: propose the correction (sandbox-rehearsed manifest) in the digest.
- [HUMAN] Approves fiche creations/corrections (same gate as T03).
- [AGENT] Country-aware completeness audit (
- Guardrails: never merge two fiches automatically; ambiguous identity → review queue.
- Today: the audit side is A3-eligible (read-only,
audit-all) but runs only on demand; corrections are manual UI work. - Target: A2 for creations/corrections; Claude tier.
Outbound — client billing
T05 — Client invoice issuance
- Trigger: 1st of month (the KissMetrics retainer), or an ad-hoc billing request.
- Mode opératoire:
- [AGENT] Inspect the recurring template (
dolibarr-recurring-templates): schedule health, next-fire date, line contents, legal mentions. Today the template hasfrequency=0— every child invoice is a manual duplication; the target state (auto-fire vs agent-fired via sandbox+promote) is an open decision in agent-architecture. - [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.
- [AGENT] Run the mandatory-mention audit on the produced PDF (
dolibarr-invoice-audit: SIRET, RCS, TVA intracom, L.441-10 penalties, 40 € indemnity, etc.). - [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.
- From 2027-09: [AGENT] submits the e-reporting data for this international transaction via the PDP (challenges C12).
- [AGENT] Inspect the recurring template (
- 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.
T06 — Receivables watch & dunning
- Trigger: weekly.
- Mode opératoire:
- [AGENT] Payment state per invoice (
dolibarr-payments-state): TTC vs recorded payments → OK / PARTIAL / UNPAID / OVERPAID, cross-checked against the contracted (deferred) payment schedule rather than naive due dates. - [AGENT] For overdue items past defined thresholds: draft the dunning email (courtesy → formal with L.441-10 late-payment interest + 40 € recovery indemnity), citing invoice facts verbatim from the ERP.
- [HUMAN] Approves each send (dunning a client is a relationship decision, not just a legal one).
- [AGENT] Journal the dunning history per invoice (feeds the next escalation level).
- [AGENT] Payment state per invoice (
- Guardrails: allowlisted recipients; never threatens beyond the contractual/legal wording; single client today → tone matters more than automation depth.
- Today: payment state is A3-eligible (read, on demand); no dunning machinery.
- Target: A1→A2 (drafts always; sends gated); Claude tier.
Bank & cash
T07 — Bank reconciliation
- Trigger: weekly (and before any T15 audit).
- Mode opératoire:
- [AGENT] Pull Qonto transactions + Wise activities for the window (
arcodange-bank-reco). - [AGENT] Match against Dolibarr payments: PASS 0 exact
transaction_id(deterministic, date-window-independent), then wire-ref, then amount+date; auto-detect Wise↔Qonto internal consolidations. - [AGENT] Emit three buckets: matched / bank-only / dolibarr-only; each bank-only movement becomes a work item (→ T08 if it pays a known invoice, → T02 if it reveals an unrecorded expense).
- [AGENT] Weekly digest line: "N matched, M to resolve"; unresolved items age visibly.
- [AGENT] Pull Qonto transactions + Wise activities for the window (
- Guardrails: read-only on both banks; the personal CCA account (
fk_account=3) is invisible via API — flagged as a permanent manual lane, not silently ignored. - Today: fully built as an on-demand skill; the tx-id loop closes when payments are recorded with
transaction_id(T08). - Target: A3 for the reconciliation report; findings feed A2 loops.
T08 — Payment recording
- Trigger: a bank-only movement matched to a known invoice (from T07).
- Mode opératoire:
- [AGENT] Build the payment manifest: invoice ref (business-key lookup), amount, date, bank account (QONTO/WISE),
transaction_idfrom the feed (so next week's reco matches deterministically), payment mode. - [AGENT] Sandbox rehearse → Telegram card (invoice, movement, remaining balance after) → [HUMAN] approve → gated promote.
- [AGENT] Verify: re-read payments, remaining-to-pay, and
payeflag transitions; journal.
- [AGENT] Build the payment manifest: invoice ref (business-key lookup), amount, date, bank account (QONTO/WISE),
- Guardrails: a payment may never exceed the invoice's remaining balance without explicit human override (partial/over-payment is a flagged decision); credit notes (avoirs) follow the same gate.
- Today:
payment-record.sh(+ supplier variant, avoirs) proven on sandbox and promotable; driven by hand. - Target: A2; Claude tier.
T09 — Cash position & runway
- Trigger: monthly (1st), and on demand.
- Mode opératoire:
- [AGENT] Live balances per account (Qonto, Wise) + Dolibarr per-
fk_accountcross-check. - [AGENT] Receivables/payables aging from the ERP; expected inflows from the contracted payment schedule.
- [AGENT] Compute runway vs fixed monthly costs; emit a one-page Markdown report into the digest + archive.
- [AGENT] Live balances per account (Qonto, Wise) + Dolibarr per-
- Guardrails: report only — no advice, no action; discrepancies bank-vs-ERP route to T07 rather than being smoothed over.
- Today: balances workflow exists in
arcodange-bank-reco. - Target: A3; M4 tier (bank data stays local), delivered through the gateway digest.
Fiscal & compliance
T10 — TVA preparation
- Trigger: the fiscal calendar (T11): acompte July 2026 (expected ≈ 0 € while in TVA credit — verify on impots.gouv.fr, never assume), acompte December 2026, CA12 for FY 2026 ~May 2027, then quarterly CA3 from 2027-Q1 (régime simplifié abolished 2027-01-01, LF 2025 art. 38).
- Mode opératoire:
- [AGENT] Aggregate the period: TVA collectée by CA3 box (box A1 domestic / box A4 intra-EU / box E2 export — today 100 % of client revenue is box E2 autoliquidation Art. 259-1°, collectée = 0) and TVA déductible by rate from supplier invoices (
dolibarr-tva-summarycomposing the two sibling skills). - [AGENT] Produce the declaration-ready sheet: per-line figures mapped to CA12/CA3 boxes, net verdict (credit vs payable), and the per-line audit trail (why each invoice lands in its bucket).
- [AGENT] Parity check against the previous filing + snapshot the underlying data (content-hash) as evidence.
- [HUMAN] Reviews the sheet, files on impots.gouv.fr, and records the filed values; [AGENT] archives sheet + confirmation and asserts filed == prepared.
- [AGENT] Aggregate the period: TVA collectée by CA3 box (box A1 domestic / box A4 intra-EU / box E2 export — today 100 % of client revenue is box E2 autoliquidation Art. 259-1°, collectée = 0) and TVA déductible by rate from supplier invoices (
- Guardrails: filing is permanently human (A1 by design); any invoice whose VAT treatment isn't derivable from the fiscal profile blocks the sheet rather than defaulting.
- Today: the whole read side is built (
dolibarr-tva-reconciliation,-deductible,-summary); scheduling, evidence archiving, and filed-parity assertions are not. - Target: A1 (by design); Claude tier.
T11 — Compliance calendar & reminders
- Trigger: daily check, 24/7.
- Mode opératoire:
- [AGENT] Maintain a machine-readable fiscal profile + calendar in git: regime (réel simplifié until 2026-12-31, quarterly CA3 after), TVA acomptes, CA12 date, CFE (cotisation foncière des entreprises, December), IS installments (once profitable), AG/annual-accounts approval (within 6 months of FY close → June 2027 for FY 2026), URSSAF/DSN payroll declarations (dormant until first salary), e-invoicing milestones.
- [AGENT] Fire reminders at D-30/D-7/D-1 via Telegram, each linking the matching preparation task (e.g. T10).
- [AGENT] When a
government-adminmail (T01) contains a deadline or an amount, propose a calendar entry/update. - [HUMAN] Confirms calendar mutations proposed from mail content (mail is untrusted input).
- Guardrails: the calendar file is reviewed like code (PR); reminders repeat until acknowledged — silence is never treated as done.
- Today: deadlines live in the operator's head + DGFiP emails; several are already documented in memory/skills but nothing fires.
- Target: A3 for reminders (Pi tier); A1 for calendar mutations sourced from mail.
T12 — Regulatory watch
- Trigger: quarterly, plus event-driven (a
government-adminmail announcing a change). - Mode opératoire:
- [AGENT] Targeted research pass over official sources (service-public, BOFiP, impots.gouv, URSSAF) scoped to the company profile: TVA regime mechanics, e-invoicing reform status (PDP list, formats, deadlines), thresholds that change obligations (CA3 monthly above 1 M€, IS rates, franchise thresholds).
- [AGENT] Emit a diff proposal against the fiscal-profile file + calendar (what changed, source links, effective dates).
- [HUMAN] Reviews and merges the PR; disagreements go to the expert-comptable question list.
- Guardrails: official sources only; every claim carries its source URL and effective date; the watch proposes, the human adopts.
- Today: ad-hoc research inside Claude sessions (this PRD's regulatory table came from one).
- Target: A1; Claude tier (web research is frontier work).
Records, audit & resilience — the floor
T13 — ERP snapshot & drift detection
- Trigger: daily, plus before/after every promoted write batch.
- Mode opératoire: [AGENT] full read-side snapshot with
content_hash(dolibarr-data-snapshot); compare against the previous hash; any drift not explained by journaled writes → alert with the object-level diff. - Guardrails: read-only; snapshots exclude binaries (GED covered by T14 backups).
- Today: skill exists, on demand. Target: A3, cluster CronJob, no LLM in the loop.
T14 — Backup & restore verification
- Trigger: daily CronJob (03:00, live since 2026-06-30: db + documents → GCS, skip-if-unchanged, 10-year tiered retention); monthly restore drill.
- Mode opératoire: [AGENT] verify last-backup freshness + fingerprint sanity daily (silence alarms if the CronJob stops); monthly: restore the latest prod backup into the sandbox, smoke-check (table count, company name, latest invoice present), report; [HUMAN] reads the drill report.
- Guardrails: drills only ever restore into the sandbox; prod restore remains a human-run runbook.
- Today: backup automated; restore proven but manual; no freshness watchdog. Target: A3.
T15 — Monthly coherence audit
- Trigger: 1st of month (after T07 has converged).
- Mode opératoire: [AGENT] compose the read skills into one audit pack: every invoice's payment state vs bank evidence, TVA bases vs invoice lines, thirdparty completeness, template health, credit-note consistency, GED attachment presence; attach the month's snapshot hash; archive the pack (git + GED); digest the exceptions only.
- Guardrails: read-only; exceptions route to the owning task's queue rather than being fixed inline.
- Today: each check exists as a skill; composition is manual (the ad-hoc "cohort review" audit sessions run in Claude Code today). Target: A3; Claude tier.
T16 — Document filing & retention
- Trigger: any new business document (invoice PDF, government letter, contract, bank statement).
- Mode opératoire: [AGENT] classify + name (
YYYY-MM-DD_type_party_ref.pdf), attach to the matching ERP object (GED) and/or the document tree, record the file hash in the journal; verify it lands in the backup scope (10-year retention, L.123-22). - Guardrails: originals are never modified or deleted; unresolvable documents go to a "to-file" queue, not a best-guess folder.
- Today: ad-hoc. Target: A2; M4 tier (documents stay local until filed).
Backlog — deferred
Explicitly out of the current inventory; each becomes a task fiche when its trigger fires:
- Paper mail — scan + ingest lane (low volume; needs a scanning habit before automation makes sense).
- Expense reports / personal-account visibility — movements on the personal CCA (
fk_account=3) are API-invisible; a manual CSV import lane or a banking-app export would open T07 coverage. - Payroll & DSN — dormant until the first salary is paid (see hub non-goals).
- Prospection/CRM admin — the
prospectionrepo exists; its admin loops (follow-ups, pipeline hygiene) can reuse this fleet's patterns later. - Contract lifecycle — renewal reminders and obligation extraction from client/supplier contracts (extraction atoms generalize naturally).