docs(erp): transmettre le choix de l'instrument aux agents suivants

L'erreur rattrapée par l'opérateur — ouvrir une fiche fournisseur au nom du
gérant — n'était pas un défaut d'exécution mais un choix d'instrument. Rien
dans le dépôt ne l'empêchait de se reproduire.

RUNBOOK_quel_instrument.md pose la question qui tranche — à qui la société
doit-elle cet argent ? — et sa table de décision : fournisseur réel → facture
fournisseur ; organisme social ou fiscal → charge ; l'associé lui-même →
paiement divers sur CCA1, sans aucun tiers. Il distingue les deux usages du
compte courant, que l'on confond facilement : le gérant AVANCE une dépense
(adc-005, le tiers est le fournisseur) contre la société DOIT au gérant
(adc-010, aucun tiers).

adc-010 enregistre la décision et sa base : le compte 455 porte les sommes dues
à l'associé, le poste fournisseurs les dettes d'exploitation envers des tiers
ayant fourni biens ou services. Le gérant qui met une pièce à disposition n'y
entre pas — même raisonnement qu'adc-008 et le runbook charges sociales
opposent déjà à l'URSSAF.

AGENTS.md porte désormais la règle dans les operating rules, avec la leçon
généralisable : une écriture dont le modèle contredit celles déjà au grand
livre est presque toujours fausse, et la vérification coûte une requête. La
règle dit aussi que le choix décide de la voie technique — ni les charges
sociales ni les paiements divers n'ayant d'API REST, le promote gated ne peut
pas les porter.

Le calendrier porte la décision de l'opérateur du 13/08 : pas de rémunération
de gérance en 2026, arbitrage reporté à 2027, avec ses conséquences — aucun
trimestre de retraite validé, et une régularisation URSSAF probablement à la
baisse puisque l'assiette réelle sera quasi nulle.

Co-Authored-By: Claude Opus 5 (1M context) <[email protected]>
This commit is contained in:
2026-08-13 21:08:08 +02:00
co-authored by Claude Opus 5
parent 67a74924e9
commit 38d2693c09
4 changed files with 262 additions and 0 deletions
+1
View File
@@ -27,6 +27,7 @@ The [AI back-office PRD](https://gitea.arcodange.lab/arcodange-org/factory/src/b
- **Prod is read-only for agents** (`ai_agent` key from `.claude/skills/dolibarr/.env`, mode 600). Beware the `voir_tous` ACL trap: a missing permission returns empty lists, not errors.
- **Writes rehearse on the sandbox first** (`ai_agent_sandbox`, host-guarded — structurally cannot reach prod), then reach prod only through the human-gated promote flow (`arcodange promote plan|apply`, prod key ENV-only + explicit confirm) — [ADR-0003](https://gitea.arcodange.lab/arcodange-org/factory/src/branch/main/vibe/ADR/0003-sandbox-state-lifecycle.md).
- **Production is an append-only ledger**: create → validate → pay → avoir; never mutate or delete a validated document, never fabricate a ref Dolibarr owns. Full grammar + anti-hallucination write contract (provenance anchors, fresh-feed corroboration, refuse-never-repair): PRD [compliance](https://gitea.arcodange.lab/arcodange-org/factory/src/branch/main/vibe/PRD/ai-back-office/compliance.md) + [agent-architecture](https://gitea.arcodange.lab/arcodange-org/factory/src/branch/main/vibe/PRD/ai-back-office/agent-architecture.md).
- **Choose the accounting instrument before writing, and read the existing state to check the choice.** *Who does the company owe?* A real supplier → supplier invoice; URSSAF or the tax office → social charge; **the associé himself → various payment on `CCA1`, with no thirdparty at all**. Neither URSSAF nor the gérant is a supplier: giving either a supplier record pollutes the auxiliary ledger, the aged balances and the payables reports, and is far costlier to undo than to avoid. The check that catches it is free — **an entry whose model contradicts the entries already in the ledger is almost always wrong**. This also decides the technical path: `/chargesociales` and `/variouspayments` have **no REST API**, so the gated promote cannot carry them (UI scripts keep the sandbox rehearsal and prod opt-in, but have no judge and no gate artefact). [RUNBOOK_quel_instrument.md](.claude/skills/dolibarr-sandbox-write/RUNBOOK_quel_instrument.md), `adc-010`.
- Sandbox state is disposable: `bin/arcodange sandbox checkpoint {status|refresh|provision|relink-env}` (refresh re-seeds iso-prod and wipes the write agent → re-provision, human login). Anything irreversible-by-design is trialed on a checkpoint first.
- Bank feeds (Qonto/Wise) and the Zoho mailbox are **read-only by construction**; no agent ever moves money.
- **Doc freshness.** Docs describe intent; the PRD STATUS + git describe reality. Before acting on any versionable claim (a path exists, a flag's value, a status emoji), verify in trust order: **live system > code/git log > [PRD STATUS](https://gitea.arcodange.lab/arcodange-org/factory/src/branch/main/vibe/PRD/ai-back-office/STATUS.md) > PRD leaves > memories**. A PR that makes a documented claim false updates that doc **in the same PR**; whoever closes a milestone follows the QA-gated [closure protocol](https://gitea.arcodange.lab/arcodange-org/factory/src/branch/main/vibe/PRD/ai-back-office/STATUS.md) — the QA gate is held by an **independent context-free subagent prompted to refute** (the closer never self-certifies) → flip STATUS → truth-pass docs → deprecation grep → fresh-reader smoke test — before the milestone closes.