How decisions are made
Every payment goes through the same steps. A wrong match is worse than no match, so anything uncertain ends with a person.
The steps
- Bank statementPayer, variable symbol (VS) and message are written by the payer: untrusted text, never instructions.
- RulesPorted from the legacy system. They settle exact matches and say why when they cannot (the codes below).
- AI modelOnly for payments the rules could not settle. It reads the text and proposes invoices from a list code prepared; a small model first, a larger one only when that can change the outcome.
- Validation by codeThe invoice exists and is open, it belongs to one customer, the amount fits, the payment names it, nothing else fits as well, no instructions in the text.
- YouConfirm, reject or match by hand what is uncertain, and undo an AI match that is wrong.
Who decided
- rule FIELD/EXACT
- A rule matched it (the code says which, see below).
- haiku-5-5
- The AI model decided it, after the rules could not; code checked its answer.
- policy
- Decided by policy without a model, e.g. instructions to an AI in the text, or no invoice of the customer at all.
- you
- You decided it.
- agent:mcp
- An AI agent proposed it through the MCP server; only a person can confirm it.
Confidence is the model's own estimate from 0 to 1. Only answers of at least 0.90 that pass every check are matched without you.
Rule codes
The first part says where the reference was found: FIELD = the VS field, MSG = the message, - = nowhere. The second says what happened.
| Code | Meaning |
|---|---|
FIELD/EXACT | Exact match: the variable symbol in the VS field names the invoice and the amount fits. |
MSG/EXACT | Exact match: the invoice number or VS was found in the message and the amount fits. |
FIELD/PARTIAL | Partial payment: the VS names the invoice, but less was paid than invoiced. |
FIELD/ADV_OVERPAY | Advance invoice paid with more than invoiced. |
FIELD/OVERPAID | More was paid than invoiced (not an advance invoice). |
MSG/OVERPAID | Invoice found in the message, but more was paid than invoiced. |
MSG/ADV_OVERPAY | Advance invoice found in the message, paid with more than invoiced. |
MSG/AMOUNT | Invoice found in the message, but less was paid than invoiced (a partial payment counts only with the VS in the VS field). |
FIELD/NOT_FOUND | The VS field names no existing invoice. |
MSG/NOT_FOUND | The message names an invoice that does not exist. |
FIELD/DUPLICATE | The invoice named in the VS field is already paid. |
MSG/DUPLICATE | The invoice named in the message is already paid. |
-/NO_VS | No variable symbol and no invoice number: the rules cannot tell which invoice. |
-/CURRENCY | A currency the rules do not handle. |
-/INVALID_AMOUNT | The amount is missing or not valid. |
-/BANK_OWN | The bank's own entry (fees, interest): not a customer payment. |