{
  "schemaVersion": 1,
  "dataset": {
    "id": "synthetic-invoice-review-v1",
    "kind": "synthetic",
    "scenarioCount": 16
  },
  "policy": {
    "baseline": "Compare supplier_id and the literal invoice_number; validate all supplied records and check amount/currency conflicts.",
    "normalization": "Candidate ignores ASCII letter case, spaces and hyphens in invoice numbers only. Supplier IDs remain exact. Leading zeros are preserved; zero-only collisions require review.",
    "matchScope": "Each independent scenario compares its final batch record with the supplied ledger and earlier batch records. Nothing is remembered across scenarios.",
    "actions": {
      "humanReviewRequired": true,
      "automaticApproval": false,
      "automaticRejection": false,
      "automaticPayment": false
    }
  },
  "summary": {
    "baseline": {
      "correct": 12,
      "total": 16,
      "counts": {
        "NEEDS_REVIEW": 7,
        "POSSIBLE_DUPLICATE": 3,
        "NO_MATCH": 6
      }
    },
    "candidate": {
      "correct": 16,
      "total": 16,
      "counts": {
        "NEEDS_REVIEW": 9,
        "POSSIBLE_DUPLICATE": 4,
        "NO_MATCH": 3
      }
    }
  },
  "measurementLimit": "Counts show agreement with manually assigned expectations on 16 deliberately chosen synthetic scenarios, not accuracy on real invoices or evidence of savings.",
  "cases": [
    {
      "id": "exact-ledger",
      "title": "Exact copy of a ledger invoice",
      "expected": "POSSIBLE_DUPLICATE",
      "input": {
        "target": {
          "id": "incoming-1",
          "supplier_id": "SUP-001",
          "invoice_number": "INV-1042",
          "amount": "120.00",
          "currency": "USD"
        },
        "ledger": [
          {
            "id": "ledger-1",
            "supplier_id": "SUP-001",
            "invoice_number": "INV-1042",
            "amount": "120.00",
            "currency": "USD"
          }
        ],
        "priorBatch": []
      },
      "baseline": {
        "classification": "POSSIBLE_DUPLICATE",
        "reason": "matching_reference",
        "explanation": "The supplier, compared invoice number, amount and currency match a supplied reference. A person must decide whether this is a duplicate.",
        "matches": [
          {
            "scope": "ledger",
            "id": "ledger-1",
            "basis": "literal_number",
            "record": {
              "id": "ledger-1",
              "supplier_id": "SUP-001",
              "invoice_number": "INV-1042",
              "amount": "120.00",
              "currency": "USD"
            }
          }
        ],
        "issues": [],
        "reviewRequired": true
      },
      "candidate": {
        "classification": "POSSIBLE_DUPLICATE",
        "reason": "matching_reference",
        "explanation": "The supplier, compared invoice number, amount and currency match a supplied reference. A person must decide whether this is a duplicate.",
        "matches": [
          {
            "scope": "ledger",
            "id": "ledger-1",
            "basis": "literal_number",
            "record": {
              "id": "ledger-1",
              "supplier_id": "SUP-001",
              "invoice_number": "INV-1042",
              "amount": "120.00",
              "currency": "USD"
            }
          }
        ],
        "issues": [],
        "reviewRequired": true
      }
    },
    {
      "id": "formatting-variation",
      "title": "Spaces replace the invoice-number hyphen",
      "expected": "POSSIBLE_DUPLICATE",
      "input": {
        "target": {
          "id": "incoming-1",
          "supplier_id": "SUP-001",
          "invoice_number": " INV 1042 ",
          "amount": "120.00",
          "currency": "USD"
        },
        "ledger": [
          {
            "id": "ledger-1",
            "supplier_id": "SUP-001",
            "invoice_number": "INV-1042",
            "amount": "120.00",
            "currency": "USD"
          }
        ],
        "priorBatch": []
      },
      "baseline": {
        "classification": "NO_MATCH",
        "reason": "no_reference_match",
        "explanation": "No reference matches within the supplied ledger and earlier batch under this rule. This is not permission to approve or pay.",
        "matches": [],
        "issues": [],
        "reviewRequired": true
      },
      "candidate": {
        "classification": "POSSIBLE_DUPLICATE",
        "reason": "matching_reference",
        "explanation": "The supplier, compared invoice number, amount and currency match a supplied reference. A person must decide whether this is a duplicate.",
        "matches": [
          {
            "scope": "ledger",
            "id": "ledger-1",
            "basis": "normalized_number",
            "record": {
              "id": "ledger-1",
              "supplier_id": "SUP-001",
              "invoice_number": "INV-1042",
              "amount": "120.00",
              "currency": "USD"
            }
          }
        ],
        "issues": [],
        "reviewRequired": true
      }
    },
    {
      "id": "letter-case",
      "title": "Invoice-number letters change case",
      "expected": "POSSIBLE_DUPLICATE",
      "input": {
        "target": {
          "id": "incoming-1",
          "supplier_id": "SUP-001",
          "invoice_number": "inv-1042",
          "amount": "120.00",
          "currency": "USD"
        },
        "ledger": [
          {
            "id": "ledger-1",
            "supplier_id": "SUP-001",
            "invoice_number": "INV-1042",
            "amount": "120.00",
            "currency": "USD"
          }
        ],
        "priorBatch": []
      },
      "baseline": {
        "classification": "NO_MATCH",
        "reason": "no_reference_match",
        "explanation": "No reference matches within the supplied ledger and earlier batch under this rule. This is not permission to approve or pay.",
        "matches": [],
        "issues": [],
        "reviewRequired": true
      },
      "candidate": {
        "classification": "POSSIBLE_DUPLICATE",
        "reason": "matching_reference",
        "explanation": "The supplier, compared invoice number, amount and currency match a supplied reference. A person must decide whether this is a duplicate.",
        "matches": [
          {
            "scope": "ledger",
            "id": "ledger-1",
            "basis": "normalized_number",
            "record": {
              "id": "ledger-1",
              "supplier_id": "SUP-001",
              "invoice_number": "INV-1042",
              "amount": "120.00",
              "currency": "USD"
            }
          }
        ],
        "issues": [],
        "reviewRequired": true
      }
    },
    {
      "id": "different-supplier",
      "title": "The same invoice number belongs to another supplier",
      "expected": "NO_MATCH",
      "input": {
        "target": {
          "id": "incoming-1",
          "supplier_id": "SUP-002",
          "invoice_number": "INV-1042",
          "amount": "120.00",
          "currency": "USD"
        },
        "ledger": [
          {
            "id": "ledger-1",
            "supplier_id": "SUP-001",
            "invoice_number": "INV-1042",
            "amount": "120.00",
            "currency": "USD"
          }
        ],
        "priorBatch": []
      },
      "baseline": {
        "classification": "NO_MATCH",
        "reason": "no_reference_match",
        "explanation": "No reference matches within the supplied ledger and earlier batch under this rule. This is not permission to approve or pay.",
        "matches": [],
        "issues": [],
        "reviewRequired": true
      },
      "candidate": {
        "classification": "NO_MATCH",
        "reason": "no_reference_match",
        "explanation": "No reference matches within the supplied ledger and earlier batch under this rule. This is not permission to approve or pay.",
        "matches": [],
        "issues": [],
        "reviewRequired": true
      }
    },
    {
      "id": "amount-conflict",
      "title": "The invoice number matches but the amount changes",
      "expected": "NEEDS_REVIEW",
      "input": {
        "target": {
          "id": "incoming-1",
          "supplier_id": "SUP-001",
          "invoice_number": "INV-1042",
          "amount": "125.00",
          "currency": "USD"
        },
        "ledger": [
          {
            "id": "ledger-1",
            "supplier_id": "SUP-001",
            "invoice_number": "INV-1042",
            "amount": "120.00",
            "currency": "USD"
          }
        ],
        "priorBatch": []
      },
      "baseline": {
        "classification": "NEEDS_REVIEW",
        "reason": "amount_or_currency_conflict",
        "explanation": "At least one matching supplier/number reference has a different amount or currency; inspect the source records.",
        "matches": [
          {
            "scope": "ledger",
            "id": "ledger-1",
            "basis": "literal_number",
            "record": {
              "id": "ledger-1",
              "supplier_id": "SUP-001",
              "invoice_number": "INV-1042",
              "amount": "120.00",
              "currency": "USD"
            }
          }
        ],
        "issues": [],
        "reviewRequired": true
      },
      "candidate": {
        "classification": "NEEDS_REVIEW",
        "reason": "amount_or_currency_conflict",
        "explanation": "At least one matching supplier/number reference has a different amount or currency; inspect the source records.",
        "matches": [
          {
            "scope": "ledger",
            "id": "ledger-1",
            "basis": "literal_number",
            "record": {
              "id": "ledger-1",
              "supplier_id": "SUP-001",
              "invoice_number": "INV-1042",
              "amount": "120.00",
              "currency": "USD"
            }
          }
        ],
        "issues": [],
        "reviewRequired": true
      }
    },
    {
      "id": "currency-conflict",
      "title": "The invoice number matches but the currency changes",
      "expected": "NEEDS_REVIEW",
      "input": {
        "target": {
          "id": "incoming-1",
          "supplier_id": "SUP-001",
          "invoice_number": "INV-1042",
          "amount": "120.00",
          "currency": "EUR"
        },
        "ledger": [
          {
            "id": "ledger-1",
            "supplier_id": "SUP-001",
            "invoice_number": "INV-1042",
            "amount": "120.00",
            "currency": "USD"
          }
        ],
        "priorBatch": []
      },
      "baseline": {
        "classification": "NEEDS_REVIEW",
        "reason": "amount_or_currency_conflict",
        "explanation": "At least one matching supplier/number reference has a different amount or currency; inspect the source records.",
        "matches": [
          {
            "scope": "ledger",
            "id": "ledger-1",
            "basis": "literal_number",
            "record": {
              "id": "ledger-1",
              "supplier_id": "SUP-001",
              "invoice_number": "INV-1042",
              "amount": "120.00",
              "currency": "USD"
            }
          }
        ],
        "issues": [],
        "reviewRequired": true
      },
      "candidate": {
        "classification": "NEEDS_REVIEW",
        "reason": "amount_or_currency_conflict",
        "explanation": "At least one matching supplier/number reference has a different amount or currency; inspect the source records.",
        "matches": [
          {
            "scope": "ledger",
            "id": "ledger-1",
            "basis": "literal_number",
            "record": {
              "id": "ledger-1",
              "supplier_id": "SUP-001",
              "invoice_number": "INV-1042",
              "amount": "120.00",
              "currency": "USD"
            }
          }
        ],
        "issues": [],
        "reviewRequired": true
      }
    },
    {
      "id": "missing-number",
      "title": "The extracted invoice number is missing",
      "expected": "NEEDS_REVIEW",
      "input": {
        "target": {
          "id": "incoming-1",
          "supplier_id": "SUP-001",
          "amount": "120.00",
          "currency": "USD"
        },
        "ledger": [
          {
            "id": "ledger-1",
            "supplier_id": "SUP-001",
            "invoice_number": "INV-1042",
            "amount": "120.00",
            "currency": "USD"
          }
        ],
        "priorBatch": []
      },
      "baseline": {
        "classification": "NEEDS_REVIEW",
        "reason": "invalid_input",
        "explanation": "The target or supplied reference data is incomplete, invalid or outside this example's supported format.",
        "matches": [],
        "issues": [
          "target: missing invoice_number",
          "target: invoice_number must contain ASCII letters/digits, spaces or hyphens, 1–64 characters"
        ],
        "reviewRequired": true
      },
      "candidate": {
        "classification": "NEEDS_REVIEW",
        "reason": "invalid_input",
        "explanation": "The target or supplied reference data is incomplete, invalid or outside this example's supported format.",
        "matches": [],
        "issues": [
          "target: missing invoice_number",
          "target: invoice_number must contain ASCII letters/digits, spaces or hyphens, 1–64 characters"
        ],
        "reviewRequired": true
      }
    },
    {
      "id": "invalid-amount",
      "title": "The amount uses an unsupported decimal separator",
      "expected": "NEEDS_REVIEW",
      "input": {
        "target": {
          "id": "incoming-1",
          "supplier_id": "SUP-001",
          "invoice_number": "INV-1042",
          "amount": "120,00",
          "currency": "USD"
        },
        "ledger": [
          {
            "id": "ledger-1",
            "supplier_id": "SUP-001",
            "invoice_number": "INV-1042",
            "amount": "120.00",
            "currency": "USD"
          }
        ],
        "priorBatch": []
      },
      "baseline": {
        "classification": "NEEDS_REVIEW",
        "reason": "invalid_input",
        "explanation": "The target or supplied reference data is incomplete, invalid or outside this example's supported format.",
        "matches": [],
        "issues": [
          "target: amount must be a positive decimal string, at most 999999999.99 and two decimal places"
        ],
        "reviewRequired": true
      },
      "candidate": {
        "classification": "NEEDS_REVIEW",
        "reason": "invalid_input",
        "explanation": "The target or supplied reference data is incomplete, invalid or outside this example's supported format.",
        "matches": [],
        "issues": [
          "target: amount must be a positive decimal string, at most 999999999.99 and two decimal places"
        ],
        "reviewRequired": true
      }
    },
    {
      "id": "leading-zero-ambiguity",
      "title": "Removing leading zeros would create a match",
      "expected": "NEEDS_REVIEW",
      "input": {
        "target": {
          "id": "incoming-1",
          "supplier_id": "SUP-001",
          "invoice_number": "INV-001042",
          "amount": "120.00",
          "currency": "USD"
        },
        "ledger": [
          {
            "id": "ledger-1",
            "supplier_id": "SUP-001",
            "invoice_number": "INV-1042",
            "amount": "120.00",
            "currency": "USD"
          }
        ],
        "priorBatch": []
      },
      "baseline": {
        "classification": "NO_MATCH",
        "reason": "no_reference_match",
        "explanation": "No reference matches within the supplied ledger and earlier batch under this rule. This is not permission to approve or pay.",
        "matches": [],
        "issues": [],
        "reviewRequired": true
      },
      "candidate": {
        "classification": "NEEDS_REVIEW",
        "reason": "ambiguous_leading_zeros",
        "explanation": "A number matches only after removing leading zeros from digit groups. The example does not assume these numbers are equivalent.",
        "matches": [
          {
            "scope": "ledger",
            "id": "ledger-1",
            "basis": "leading_zero_ambiguity",
            "record": {
              "id": "ledger-1",
              "supplier_id": "SUP-001",
              "invoice_number": "INV-1042",
              "amount": "120.00",
              "currency": "USD"
            }
          }
        ],
        "issues": [],
        "reviewRequired": true
      }
    },
    {
      "id": "earlier-batch-copy",
      "title": "A duplicate is present earlier in the current batch",
      "expected": "POSSIBLE_DUPLICATE",
      "input": {
        "target": {
          "id": "incoming-1",
          "supplier_id": "SUP-001",
          "invoice_number": "INV-1042",
          "amount": "120.00",
          "currency": "USD"
        },
        "ledger": [],
        "priorBatch": [
          {
            "id": "batch-1",
            "supplier_id": "SUP-001",
            "invoice_number": "INV-1042",
            "amount": "120.00",
            "currency": "USD"
          }
        ]
      },
      "baseline": {
        "classification": "POSSIBLE_DUPLICATE",
        "reason": "matching_reference",
        "explanation": "The supplier, compared invoice number, amount and currency match a supplied reference. A person must decide whether this is a duplicate.",
        "matches": [
          {
            "scope": "batch",
            "id": "batch-1",
            "basis": "literal_number",
            "record": {
              "id": "batch-1",
              "supplier_id": "SUP-001",
              "invoice_number": "INV-1042",
              "amount": "120.00",
              "currency": "USD"
            }
          }
        ],
        "issues": [],
        "reviewRequired": true
      },
      "candidate": {
        "classification": "POSSIBLE_DUPLICATE",
        "reason": "matching_reference",
        "explanation": "The supplier, compared invoice number, amount and currency match a supplied reference. A person must decide whether this is a duplicate.",
        "matches": [
          {
            "scope": "batch",
            "id": "batch-1",
            "basis": "literal_number",
            "record": {
              "id": "batch-1",
              "supplier_id": "SUP-001",
              "invoice_number": "INV-1042",
              "amount": "120.00",
              "currency": "USD"
            }
          }
        ],
        "issues": [],
        "reviewRequired": true
      }
    },
    {
      "id": "new-number",
      "title": "No matching invoice number exists in the supplied context",
      "expected": "NO_MATCH",
      "input": {
        "target": {
          "id": "incoming-1",
          "supplier_id": "SUP-001",
          "invoice_number": "INV-1043",
          "amount": "120.00",
          "currency": "USD"
        },
        "ledger": [
          {
            "id": "ledger-1",
            "supplier_id": "SUP-001",
            "invoice_number": "INV-1042",
            "amount": "120.00",
            "currency": "USD"
          }
        ],
        "priorBatch": []
      },
      "baseline": {
        "classification": "NO_MATCH",
        "reason": "no_reference_match",
        "explanation": "No reference matches within the supplied ledger and earlier batch under this rule. This is not permission to approve or pay.",
        "matches": [],
        "issues": [],
        "reviewRequired": true
      },
      "candidate": {
        "classification": "NO_MATCH",
        "reason": "no_reference_match",
        "explanation": "No reference matches within the supplied ledger and earlier batch under this rule. This is not permission to approve or pay.",
        "matches": [],
        "issues": [],
        "reviewRequired": true
      }
    },
    {
      "id": "repeated-input-id",
      "title": "The same input record ID appears twice",
      "expected": "NEEDS_REVIEW",
      "input": {
        "target": {
          "id": "incoming-1",
          "supplier_id": "SUP-001",
          "invoice_number": "INV-1042",
          "amount": "120.00",
          "currency": "USD"
        },
        "ledger": [],
        "priorBatch": [
          {
            "id": "incoming-1",
            "supplier_id": "SUP-001",
            "invoice_number": "INV-1042",
            "amount": "120.00",
            "currency": "USD"
          }
        ]
      },
      "baseline": {
        "classification": "NEEDS_REVIEW",
        "reason": "repeated_record_id",
        "explanation": "A record ID occurs more than once in the supplied context; check the import before interpreting matches.",
        "matches": [],
        "issues": [
          "repeated id: incoming-1"
        ],
        "reviewRequired": true
      },
      "candidate": {
        "classification": "NEEDS_REVIEW",
        "reason": "repeated_record_id",
        "explanation": "A record ID occurs more than once in the supplied context; check the import before interpreting matches.",
        "matches": [],
        "issues": [
          "repeated id: incoming-1"
        ],
        "reviewRequired": true
      }
    },
    {
      "id": "mixed-reference-conflict",
      "title": "An exact match and a formatted match disagree on amount",
      "expected": "NEEDS_REVIEW",
      "input": {
        "target": {
          "id": "incoming-1",
          "supplier_id": "SUP-001",
          "invoice_number": "INV-1042",
          "amount": "120.00",
          "currency": "USD"
        },
        "ledger": [
          {
            "id": "ledger-1",
            "supplier_id": "SUP-001",
            "invoice_number": "INV-1042",
            "amount": "120.00",
            "currency": "USD"
          },
          {
            "id": "ledger-2",
            "supplier_id": "SUP-001",
            "invoice_number": "inv 1042",
            "amount": "125.00",
            "currency": "USD"
          }
        ],
        "priorBatch": []
      },
      "baseline": {
        "classification": "POSSIBLE_DUPLICATE",
        "reason": "matching_reference",
        "explanation": "The supplier, compared invoice number, amount and currency match a supplied reference. A person must decide whether this is a duplicate.",
        "matches": [
          {
            "scope": "ledger",
            "id": "ledger-1",
            "basis": "literal_number",
            "record": {
              "id": "ledger-1",
              "supplier_id": "SUP-001",
              "invoice_number": "INV-1042",
              "amount": "120.00",
              "currency": "USD"
            }
          }
        ],
        "issues": [],
        "reviewRequired": true
      },
      "candidate": {
        "classification": "NEEDS_REVIEW",
        "reason": "amount_or_currency_conflict",
        "explanation": "At least one matching supplier/number reference has a different amount or currency; inspect the source records.",
        "matches": [
          {
            "scope": "ledger",
            "id": "ledger-1",
            "basis": "literal_number",
            "record": {
              "id": "ledger-1",
              "supplier_id": "SUP-001",
              "invoice_number": "INV-1042",
              "amount": "120.00",
              "currency": "USD"
            }
          },
          {
            "scope": "ledger",
            "id": "ledger-2",
            "basis": "normalized_number",
            "record": {
              "id": "ledger-2",
              "supplier_id": "SUP-001",
              "invoice_number": "inv 1042",
              "amount": "125.00",
              "currency": "USD"
            }
          }
        ],
        "issues": [],
        "reviewRequired": true
      }
    },
    {
      "id": "invalid-reference",
      "title": "An earlier reference invoice has incomplete data",
      "expected": "NEEDS_REVIEW",
      "input": {
        "target": {
          "id": "incoming-1",
          "supplier_id": "SUP-001",
          "invoice_number": "INV-1042",
          "amount": "120.00",
          "currency": "USD"
        },
        "ledger": [
          {
            "id": "ledger-1",
            "supplier_id": "SUP-001",
            "invoice_number": "INV-1042",
            "currency": "USD"
          }
        ],
        "priorBatch": []
      },
      "baseline": {
        "classification": "NEEDS_REVIEW",
        "reason": "invalid_input",
        "explanation": "The target or supplied reference data is incomplete, invalid or outside this example's supported format.",
        "matches": [],
        "issues": [
          "ledger[0]: missing amount",
          "ledger[0]: amount must be a positive decimal string, at most 999999999.99 and two decimal places"
        ],
        "reviewRequired": true
      },
      "candidate": {
        "classification": "NEEDS_REVIEW",
        "reason": "invalid_input",
        "explanation": "The target or supplied reference data is incomplete, invalid or outside this example's supported format.",
        "matches": [],
        "issues": [
          "ledger[0]: missing amount",
          "ledger[0]: amount must be a positive decimal string, at most 999999999.99 and two decimal places"
        ],
        "reviewRequired": true
      }
    },
    {
      "id": "distinct-leading-zero-number",
      "title": "Leading zeros are kept on a genuinely different number",
      "expected": "NO_MATCH",
      "input": {
        "target": {
          "id": "incoming-1",
          "supplier_id": "SUP-001",
          "invoice_number": "INV-001043",
          "amount": "120.00",
          "currency": "USD"
        },
        "ledger": [
          {
            "id": "ledger-1",
            "supplier_id": "SUP-001",
            "invoice_number": "INV-1042",
            "amount": "120.00",
            "currency": "USD"
          }
        ],
        "priorBatch": []
      },
      "baseline": {
        "classification": "NO_MATCH",
        "reason": "no_reference_match",
        "explanation": "No reference matches within the supplied ledger and earlier batch under this rule. This is not permission to approve or pay.",
        "matches": [],
        "issues": [],
        "reviewRequired": true
      },
      "candidate": {
        "classification": "NO_MATCH",
        "reason": "no_reference_match",
        "explanation": "No reference matches within the supplied ledger and earlier batch under this rule. This is not permission to approve or pay.",
        "matches": [],
        "issues": [],
        "reviewRequired": true
      }
    },
    {
      "id": "unsupported-currency",
      "title": "The invoice currency is outside this example",
      "expected": "NEEDS_REVIEW",
      "input": {
        "target": {
          "id": "incoming-1",
          "supplier_id": "SUP-001",
          "invoice_number": "INV-1042",
          "amount": "120.00",
          "currency": "JPY"
        },
        "ledger": [
          {
            "id": "ledger-1",
            "supplier_id": "SUP-001",
            "invoice_number": "INV-1042",
            "amount": "120.00",
            "currency": "USD"
          }
        ],
        "priorBatch": []
      },
      "baseline": {
        "classification": "NEEDS_REVIEW",
        "reason": "invalid_input",
        "explanation": "The target or supplied reference data is incomplete, invalid or outside this example's supported format.",
        "matches": [],
        "issues": [
          "target: currency must be USD, EUR or GBP in this example"
        ],
        "reviewRequired": true
      },
      "candidate": {
        "classification": "NEEDS_REVIEW",
        "reason": "invalid_input",
        "explanation": "The target or supplied reference data is incomplete, invalid or outside this example's supported format.",
        "matches": [],
        "issues": [
          "target: currency must be USD, EUR or GBP in this example"
        ],
        "reviewRequired": true
      }
    }
  ]
}
