arcodange-bank-reco: add known-patterns.json catalog + bank-match annotation

V6.1 follow-up to the bank-reco V6 ship. Splits the BANK-ONLY bucket into
"known patterns" (intentional gaps, documented and classified) vs
"unknown" (real action items).

What the catalog covers today:
- FOUREZ Quentin → capital_deposit (apport en capital 1000 € initial,
  notaire FOUREZ centralisateur du dépôt). Maps to Dolibarr account 1013.
- URSSAF → social_charges (account 645100)
- MISTRAL.AI, CLAUDE.AI → ai_subscription (account 6262)
- Wise *Plan, qonto_fee → bank_fee (account 627)
- BALANCE_DEPOSIT / FEATURE_CHARGE on Wise → internal_topup (self-funding
  pair, often nets to zero)

Effect on the V6 baseline (Jan-May 2026):
- Before catalog: 8 BANK-ONLY mixed entries (noise + signal)
- After catalog:  7 known + 1 UNKNOWN (just the +2147 € KM Wise payment
  2026-05-29 that genuinely needs a Dolibarr entry)

The catalog is JSON (not YAML — stdlib only, no dependency). Schema
documented in SKILL.md. Pattern matches case-insensitive regex against
both bank label AND operation type. Optional filters: bank, side,
amount_min, amount_max.

Exit code now reflects only the UNKNOWN bank-only and dolibarr-only
counts — the verdict is no longer noisy because of intentional gaps.

Edit known-patterns.json as new recurring patterns emerge.

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
This commit is contained in:
2026-05-31 14:06:46 +02:00
parent f398003eae
commit 4b6a5f7529
4 changed files with 170 additions and 16 deletions

View File

@@ -0,0 +1,60 @@
{
"_schema": "v1",
"_description": "Operator-curated catalogue of known recurring/intentional bank movements. Used by bank-match.sh to annotate the BANK-ONLY bucket so the operator can immediately tell 'needs Dolibarr entry' from 'documented intentional gap'. Edit this file as new recurring patterns emerge.",
"_match_rules": "Pattern matched case-insensitively as a regex against the bank label. Optional filters: bank (qonto|wise), side (credit|debit), amount_min, amount_max, type (Wise activity type). All present filters must match.",
"_classifications": {
"capital_deposit": "Apport en capital social. Dolibarr account 1013 (capital souscrit appelé versé).",
"social_charges": "URSSAF, retraite complémentaire, etc. Dolibarr account 645x.",
"ai_subscription": "Claude / Mistral / OpenAI / similar. Dolibarr account 6262 (frais télécom / abonnements logiciels).",
"bank_fee": "Plan bancaire, frais d'opération, refunds. Dolibarr account 627 (services bancaires).",
"internal_topup": "Solde Wise/Qonto rechargé pour couvrir un frais immédiat. Often nets out.",
"personal_apport": "Apport en compte courant d'associé (Gabriel finançant Arcodange depuis son perso). Dolibarr account 4551.",
"needs_classification": "Pattern catched but no Dolibarr account assignment defined yet; surface for review."
},
"patterns": [
{
"pattern": "FOUREZ.*Quentin",
"classification": "capital_deposit",
"bank": "qonto",
"side": "credit",
"note": "Apport en capital social initial 1000 €. Maître FOUREZ Quentin, notaire centralisateur du dépôt. Date typique : 2026-01-21. Dolibarr: account 1013."
},
{
"pattern": "URSSAF",
"classification": "social_charges",
"bank": "qonto",
"side": "debit",
"note": "Cotisations sociales URSSAF (régime mensuel/trimestriel). Dolibarr: account 645100 (charges de sécurité sociale)."
},
{
"pattern": "MISTRAL\\.AI",
"classification": "ai_subscription",
"side": "debit",
"note": "Mistral AI API subscription. Récurrent mensuel. Dolibarr: account 6262 + supplier 'Mistral AI'."
},
{
"pattern": "CLAUDE\\.AI",
"classification": "ai_subscription",
"side": "debit",
"note": "Claude AI subscription (Anthropic). Récurrent mensuel. Dolibarr: account 6262 + supplier 'Anthropic'."
},
{
"pattern": "Wise.*Plan",
"classification": "bank_fee",
"side": "debit",
"note": "Wise account plan billed via card. Wise's internal fee for keeping the BUSINESS profile active."
},
{
"pattern": "qonto_fee",
"classification": "bank_fee",
"bank": "qonto",
"note": "Qonto fees ou refunds. Petites valeurs. Dolibarr: account 627."
},
{
"pattern": "BALANCE_DEPOSIT|For your account plan",
"classification": "internal_topup",
"bank": "wise",
"note": "Solde Wise rechargé pour couvrir un frais immédiat (souvent net zéro avec le FEATURE_CHARGE du même jour)."
}
]
}