feat(fleet): golden set + injection fixtures from real history (erp#39)

Seed the invoice-extract (T02) and mail-classify (T01) golden sets from real
Arcodange history, plus an adversarial injection suite and an offline
field-level scorer.

invoice-extract/
- 16 real supplier PDFs (DARNIS/Hiway F1040/F1042/F1045/F1046, Anthropic
  invoice+receipt x2, Mistral, OVH, greffe d'Evry, INPI x2, Legalstart, Qonto,
  Infogreffe) fetched from the Zoho mailbox + Dolibarr GED, each with a
  hand-verified expected JSON per the T02 schema. Every expected value was
  cross-checked against the pdftotext -layout text and re-validated against the
  deterministic invariants (HT+TVA=TTC, per-rate sums, IBAN mod-97, SIREN Luhn).
- inputs/ carries both the source PDF and its {source_sha256, mime, text} pair.
- 6 SYNTHETIC injection fixtures (LLM-directive, hidden white text, IBAN-swap
  BEC lure, arithmetic-repair lure, fake tool-call, ref-hijack duplicate) whose
  only correct outcome is quarantine; each PDF is marked SYNTHETIC.
- score.py: stdlib-only field-level scorer, critical fields (amounts/IBAN/refs/
  dates) scored separately against the 98% bar, injection leaks blocking; a
  built-in --self-test proves it catches perturbed fields and leaks.
- manifest.json: per-item provenance (mail message id / GED path + sha256),
  linked Dolibarr supplier invoice, a verification note, and the list of real
  documents deliberately excluded (fee statements, payment proofs, La Poste
  receipts with no HT/TVA breakdown) with reasons.

mail-classify/
- 1824 historical mails labeled into {supplier-invoice, bank-notice,
  government-admin, client, other} via sender-domain + subject weak supervision,
  one human-correctable JSONL line per message with confidence + reason +
  message-id provenance. manifest.json records the pull method and distribution.

Docs: golden/README hub, invoice-extract/README (T02 schema + conventions),
injection/README (threat table), mail-classify/README (method + distribution).

Co-Authored-By: Claude Fable 5 <[email protected]>
Claude-Session: https://claude.ai/code/session_01VRShc4QhLLU73FLHx9vskh
This commit is contained in:
2026-07-18 19:07:58 +02:00
co-authored by Claude Fable 5
parent fe6909a2a6
commit 6df4693880
74 changed files with 3631 additions and 1 deletions
@@ -0,0 +1,27 @@
{
"supplier": {
"name": "Anthropic Ireland, Limited",
"siren": null,
"tva_intra": "IE4276970QH"
},
"ref_supplier": "9BF0758D-3321065",
"date_issue": "2026-06-21",
"date_due": "2026-06-21",
"currency": "EUR",
"per_rate": [
{
"rate": 0,
"ht": 180.0,
"tva": 0.0
}
],
"totals": {
"ht": 180.0,
"tva": 0.0,
"ttc": 180.0
},
"reverse_charge": true,
"iban": null,
"service_vs_goods": "service",
"period_covered": "2026-06-21..2026-07-21"
}
@@ -0,0 +1,27 @@
{
"supplier": {
"name": "Anthropic Ireland, Limited",
"siren": null,
"tva_intra": null
},
"ref_supplier": "9BF0758D-695749",
"date_issue": "2026-04-12",
"date_due": "2026-04-12",
"currency": "EUR",
"per_rate": [
{
"rate": 0,
"ht": 180.0,
"tva": 0.0
}
],
"totals": {
"ht": 180.0,
"tva": 0.0,
"ttc": 180.0
},
"reverse_charge": true,
"iban": null,
"service_vs_goods": "service",
"period_covered": "2026-04-12..2027-04-12"
}
@@ -0,0 +1,27 @@
{
"supplier": {
"name": "Anthropic Ireland, Limited",
"siren": null,
"tva_intra": null
},
"ref_supplier": "9BF0758D-695749",
"date_issue": "2026-04-12",
"date_due": null,
"currency": "EUR",
"per_rate": [
{
"rate": 0,
"ht": 180.0,
"tva": 0.0
}
],
"totals": {
"ht": 180.0,
"tva": 0.0,
"ttc": 180.0
},
"reverse_charge": true,
"iban": null,
"service_vs_goods": "service",
"period_covered": "2026-04-12..2027-04-12"
}
@@ -0,0 +1,27 @@
{
"supplier": {
"name": "Anthropic Ireland, Limited",
"siren": null,
"tva_intra": "IE4276970QH"
},
"ref_supplier": "9BF0758D-3321065",
"date_issue": "2026-06-21",
"date_due": null,
"currency": "EUR",
"per_rate": [
{
"rate": 0,
"ht": 180.0,
"tva": 0.0
}
],
"totals": {
"ht": 180.0,
"tva": 0.0,
"ttc": 180.0
},
"reverse_charge": true,
"iban": null,
"service_vs_goods": "service",
"period_covered": "2026-06-21..2026-07-21"
}
@@ -0,0 +1,27 @@
{
"supplier": {
"name": "Darnis Operations",
"siren": "920267531",
"tva_intra": "FR51920267531"
},
"ref_supplier": "F1040",
"date_issue": "2026-02-28",
"date_due": "2026-02-28",
"currency": "EUR",
"per_rate": [
{
"rate": 20,
"ht": 510.0,
"tva": 102.0
}
],
"totals": {
"ht": 510.0,
"tva": 102.0,
"ttc": 612.0
},
"reverse_charge": false,
"iban": "FR7616958000016837364325983",
"service_vs_goods": "service",
"period_covered": "2026-02"
}
@@ -0,0 +1,27 @@
{
"supplier": {
"name": "Darnis Operations",
"siren": "920267531",
"tva_intra": "FR51920267531"
},
"ref_supplier": "F1042",
"date_issue": "2026-03-31",
"date_due": "2026-03-31",
"currency": "EUR",
"per_rate": [
{
"rate": 20,
"ht": 255.0,
"tva": 51.0
}
],
"totals": {
"ht": 255.0,
"tva": 51.0,
"ttc": 306.0
},
"reverse_charge": false,
"iban": "FR7616958000016837364325983",
"service_vs_goods": "service",
"period_covered": "2026-03"
}
@@ -0,0 +1,27 @@
{
"supplier": {
"name": "Darnis Operations",
"siren": "920267531",
"tva_intra": "FR51920267531"
},
"ref_supplier": "F1045",
"date_issue": "2026-06-30",
"date_due": "2026-06-30",
"currency": "EUR",
"per_rate": [
{
"rate": 20,
"ht": 214.7,
"tva": 42.94
}
],
"totals": {
"ht": 214.7,
"tva": 42.94,
"ttc": 257.64
},
"reverse_charge": false,
"iban": "FR7616958000016837364325983",
"service_vs_goods": "service",
"period_covered": "2026-06"
}
@@ -0,0 +1,27 @@
{
"supplier": {
"name": "Darnis Operations",
"siren": "920267531",
"tva_intra": "FR51920267531"
},
"ref_supplier": "F1046",
"date_issue": "2026-06-29",
"date_due": "2026-06-29",
"currency": "EUR",
"per_rate": [
{
"rate": 20,
"ht": 219.5,
"tva": 43.9
}
],
"totals": {
"ht": 219.5,
"tva": 43.9,
"ttc": 263.4
},
"reverse_charge": false,
"iban": "FR7616958000016837364325983",
"service_vs_goods": "service",
"period_covered": "2026-06"
}
@@ -0,0 +1,27 @@
{
"supplier": {
"name": "SELARL GTC EVRY",
"siren": "326467370",
"tva_intra": "FR09326467370"
},
"ref_supplier": "26004975",
"date_issue": "2026-01-16",
"date_due": null,
"currency": "EUR",
"per_rate": [
{
"rate": 20,
"ht": 47.69,
"tva": 9.54
}
],
"totals": {
"ht": 47.69,
"tva": 9.54,
"ttc": 57.23
},
"reverse_charge": false,
"iban": "FR2820041000010598914Z02070",
"service_vs_goods": "service",
"period_covered": null
}
@@ -0,0 +1,27 @@
{
"supplier": {
"name": "INFOGREFFE",
"siren": "338885718",
"tva_intra": "FR69338885718"
},
"ref_supplier": "60117-ZMHMT",
"date_issue": "2026-01-17",
"date_due": null,
"currency": "EUR",
"per_rate": [
{
"rate": 20,
"ht": 2.67,
"tva": 0.53
}
],
"totals": {
"ht": 2.67,
"tva": 0.53,
"ttc": 3.2
},
"reverse_charge": false,
"iban": null,
"service_vs_goods": "service",
"period_covered": null
}
@@ -0,0 +1,27 @@
{
"supplier": {
"name": "Institut national de la propriété industrielle",
"siren": null,
"tva_intra": null
},
"ref_supplier": "16834370",
"date_issue": "2026-01-09",
"date_due": null,
"currency": "EUR",
"per_rate": [
{
"rate": 20,
"ht": 46.61,
"tva": 9.32
}
],
"totals": {
"ht": 46.61,
"tva": 9.32,
"ttc": 55.93
},
"reverse_charge": false,
"iban": null,
"service_vs_goods": "service",
"period_covered": null
}
@@ -0,0 +1,27 @@
{
"supplier": {
"name": "Institut national de la propriété industrielle",
"siren": null,
"tva_intra": null
},
"ref_supplier": "16937156",
"date_issue": "2026-01-15",
"date_due": null,
"currency": "EUR",
"per_rate": [
{
"rate": 20,
"ht": 1.08,
"tva": 0.22
}
],
"totals": {
"ht": 1.08,
"tva": 0.22,
"ttc": 1.3
},
"reverse_charge": false,
"iban": null,
"service_vs_goods": "service",
"period_covered": null
}
@@ -0,0 +1,27 @@
{
"supplier": {
"name": "Yolaw",
"siren": "753892926",
"tva_intra": "FR18753892926"
},
"ref_supplier": "1091237202601",
"date_issue": "2026-01-04",
"date_due": null,
"currency": "EUR",
"per_rate": [
{
"rate": 20,
"ht": 1.66,
"tva": 0.33
}
],
"totals": {
"ht": 1.66,
"tva": 0.33,
"ttc": 1.99
},
"reverse_charge": false,
"iban": null,
"service_vs_goods": "service",
"period_covered": null
}
@@ -0,0 +1,27 @@
{
"supplier": {
"name": "Mistral AI SAS",
"siren": "952418325",
"tva_intra": "FR95952418325"
},
"ref_supplier": "MSTRL-API-814045-001",
"date_issue": "2026-04-02",
"date_due": "2026-04-02",
"currency": "EUR",
"per_rate": [
{
"rate": 20,
"ht": 143.9,
"tva": 28.78
}
],
"totals": {
"ht": 143.9,
"tva": 28.78,
"ttc": 172.68
},
"reverse_charge": false,
"iban": null,
"service_vs_goods": "service",
"period_covered": "2026-04-02..2027-04-01"
}
@@ -0,0 +1,27 @@
{
"supplier": {
"name": "OVH",
"siren": "424761419",
"tva_intra": "FR22424761419"
},
"ref_supplier": "FR73261832",
"date_issue": "2025-10-24",
"date_due": null,
"currency": "EUR",
"per_rate": [
{
"rate": 20,
"ht": 6.08,
"tva": 1.22
}
],
"totals": {
"ht": 6.08,
"tva": 1.22,
"ttc": 7.3
},
"reverse_charge": false,
"iban": "FR7630056005030503000004147",
"service_vs_goods": "service",
"period_covered": null
}
@@ -0,0 +1,27 @@
{
"supplier": {
"name": "Qonto (Olinda SAS)",
"siren": "819489626",
"tva_intra": "FR10819489626"
},
"ref_supplier": "06-01-26-payment-366753",
"date_issue": "2026-01-06",
"date_due": "2026-01-06",
"currency": "EUR",
"per_rate": [
{
"rate": 20,
"ht": 169.0,
"tva": 33.8
}
],
"totals": {
"ht": 169.0,
"tva": 33.8,
"ttc": 202.8
},
"reverse_charge": false,
"iban": null,
"service_vs_goods": "service",
"period_covered": null
}