{
  "schemaVersion": 1,
  "slug": "ai-invoice-reconciliation-exceptions",
  "inputMode": "Synthetic fixture",
  "tool": "OpenAI coding assistant",
  "model": "Exact model identifier not disclosed by the session",
  "runDisclosure": "No external, live, or production action occurred. The reconciliation used only the fictional invoice and payment records saved in this evidence file.",
  "task": "Reconcile six fictional invoices against seven fictional payments without silently accepting amount mismatches, partial payments, missing references, or unknown invoice references.",
  "fixture": {
    "currency": "USD",
    "invoices": [
      { "invoiceId": "INV-1001", "vendor": "Acme North", "amount": 1250.00 },
      { "invoiceId": "INV-1002", "vendor": "Blue Finch", "amount": 845.50 },
      { "invoiceId": "INV-1003", "vendor": "Cedar Labs", "amount": 600.00 },
      { "invoiceId": "INV-1004", "vendor": "Delta Foods", "amount": 980.00 },
      { "invoiceId": "INV-1005", "vendor": "Echo Retail", "amount": 450.00 },
      { "invoiceId": "INV-1006", "vendor": "Fable Works", "amount": 1200.00 }
    ],
    "payments": [
      { "paymentId": "PAY-9001", "reference": "INV-1001", "vendor": "Acme North", "amount": 1250.00 },
      { "paymentId": "PAY-9002", "reference": "INV-1002", "vendor": "Blue Finch", "amount": 845.50 },
      { "paymentId": "PAY-9003", "reference": "INV-1003", "vendor": "Cedar Labs", "amount": 599.99 },
      { "paymentId": "PAY-9004", "reference": "INV-1005", "vendor": "Echo Retail", "amount": 450.00 },
      { "paymentId": "PAY-9005", "reference": "", "vendor": "Delta Foods", "amount": 980.00 },
      { "paymentId": "PAY-9006", "reference": "INV-1006", "vendor": "Fable Works", "amount": 1000.00 },
      { "paymentId": "PAY-9007", "reference": "INV-9999", "vendor": "Granite Office", "amount": 320.00 }
    ],
    "rules": [
      "Settle an invoice only when invoice reference and amount both match exactly.",
      "Treat a lower referenced amount as a partial payment and show the remaining balance.",
      "Keep a payment without an invoice reference in manual review even when vendor and amount look plausible.",
      "Keep an unknown invoice reference unapplied.",
      "Account for every source record and show outstanding and unapplied totals."
    ]
  },
  "prompt": "Reconcile the six invoices and seven payments in the supplied fixture. Return an invoice table with status, applied payment IDs, and outstanding balance, plus an unapplied-payment table. Settle an invoice only when the reference and amount are exact. Do not infer a match from vendor and amount alone. Preserve every record and show totals.",
  "firstResult": {
    "summary": "The answer presented all thirteen records but treated near or plausible matches as settled and understated both exception totals.",
    "invoiceStatuses": [
      { "invoiceId": "INV-1001", "status": "settled", "appliedPaymentIds": ["PAY-9001"], "outstanding": 0.00 },
      { "invoiceId": "INV-1002", "status": "settled", "appliedPaymentIds": ["PAY-9002"], "outstanding": 0.00 },
      { "invoiceId": "INV-1003", "status": "settled with rounding", "appliedPaymentIds": ["PAY-9003"], "outstanding": 0.00 },
      { "invoiceId": "INV-1004", "status": "settled by vendor and amount", "appliedPaymentIds": ["PAY-9005"], "outstanding": 0.00 },
      { "invoiceId": "INV-1005", "status": "settled", "appliedPaymentIds": ["PAY-9004"], "outstanding": 0.00 },
      { "invoiceId": "INV-1006", "status": "settled", "appliedPaymentIds": ["PAY-9006"], "outstanding": 0.00 }
    ],
    "unappliedPayments": ["PAY-9007"],
    "outstandingInvoiceTotal": 0.00,
    "unappliedPaymentTotal": 320.00
  },
  "correctionPrompt": "Your reconciliation preserved the records and found the three exact full matches, but it broke three rules: PAY-9003 is one cent short and must leave INV-1003 partially paid; PAY-9005 has no invoice reference and must remain in manual review; PAY-9006 is a partial payment and must leave 200.00 outstanding. Recalculate outstanding and unapplied totals without changing valid exact matches.",
  "finalResult": {
    "summary": "The corrected result retained the exact matches, isolated every exception, and balanced the outstanding and unapplied totals to the fixture.",
    "invoiceStatuses": [
      { "invoiceId": "INV-1001", "status": "settled", "appliedPaymentIds": ["PAY-9001"], "outstanding": 0.00 },
      { "invoiceId": "INV-1002", "status": "settled", "appliedPaymentIds": ["PAY-9002"], "outstanding": 0.00 },
      { "invoiceId": "INV-1003", "status": "partially paid", "appliedPaymentIds": ["PAY-9003"], "outstanding": 0.01 },
      { "invoiceId": "INV-1004", "status": "open", "appliedPaymentIds": [], "outstanding": 980.00 },
      { "invoiceId": "INV-1005", "status": "settled", "appliedPaymentIds": ["PAY-9004"], "outstanding": 0.00 },
      { "invoiceId": "INV-1006", "status": "partially paid", "appliedPaymentIds": ["PAY-9006"], "outstanding": 200.00 }
    ],
    "unappliedPayments": [
      { "paymentId": "PAY-9005", "reason": "missing invoice reference; vendor and amount are only a review hint" },
      { "paymentId": "PAY-9007", "reason": "reference INV-9999 is absent from the invoice fixture" }
    ],
    "outstandingInvoiceTotal": 1180.01,
    "unappliedPaymentTotal": 1300.00
  },
  "checks": [
    { "name": "Every source record accounted for", "firstPass": true, "finalPass": true, "evidence": "Both results contain all six invoice IDs and account for all seven payment IDs either as applied or unapplied." },
    { "name": "Exact full matches identified", "firstPass": true, "finalPass": true, "evidence": "PAY-9001, PAY-9002, and PAY-9004 match both reference and amount and remain settled in both result versions." },
    { "name": "Amount mismatches remain partial", "firstPass": false, "finalPass": true, "evidence": "The corrected result leaves 0.01 on INV-1003 and 200.00 on INV-1006 instead of silently settling either invoice." },
    { "name": "Missing and unknown references isolated", "firstPass": false, "finalPass": true, "evidence": "The corrected unapplied table retains PAY-9005 for manual review and PAY-9007 because INV-9999 does not exist." },
    { "name": "Exception totals reconcile", "firstPass": false, "finalPass": true, "evidence": "Corrected outstanding invoices total 1180.01 and unapplied payments total 1300.00, exactly matching the listed rows." }
  ],
  "initialScore": 4,
  "score": 10,
  "verdict": "worked",
  "limitations": [
    "The fixture has six invoices and does not cover taxes, credit notes, duplicate bank entries, foreign exchange, or payment fees.",
    "No accounting system or bank account was accessed; a qualified owner must review real reconciliation policy and exceptions."
  ]
}
