{
  "tool_id": "art-464-confirmation-matcher",
  "note": "golden_hash filled by golden-parity.test.mjs --update; output_payload filled by fill-fixture-payloads.mjs. Vector 1: exact match, tolerance match, mismatch, no-ledger, no-confirmation -- one of each classification. Vector 2: exact-tolerance-required (0/0 default) mismatch case. Vector 3: no confirmations or ledger balances -- finite gate.",
  "vectors": [
    {
      "name": "five_way_classification",
      "description": "5 confirmation/ledger pairs covering every classification: exact match, within-tolerance match (tolerance_pct=2), outright mismatch, confirmation with no ledger entry, and ledger entry with no confirmation.",
      "policy_parameters": {
        "tolerance_abs": 0,
        "tolerance_pct": 2,
        "confirmations": [
          {
            "confirmation_id": "C-1",
            "counterparty_id": "cp-A",
            "type": "bank",
            "confirmed_balance": 100000,
            "confirmation_date": "2026-01-31"
          },
          {
            "confirmation_id": "C-2",
            "counterparty_id": "cp-B",
            "type": "bank",
            "confirmed_balance": 50100,
            "confirmation_date": "2026-01-31"
          },
          {
            "confirmation_id": "C-3",
            "counterparty_id": "cp-C",
            "type": "ar",
            "confirmed_balance": 20000,
            "confirmation_date": "2026-01-31"
          },
          {
            "confirmation_id": "C-4",
            "counterparty_id": "cp-D",
            "type": "ar",
            "confirmed_balance": 7500,
            "confirmation_date": "2026-01-31"
          }
        ],
        "ledger_balances": [
          {
            "counterparty_id": "cp-A",
            "type": "bank",
            "ledger_balance": 100000,
            "as_of_date": "2026-01-31"
          },
          {
            "counterparty_id": "cp-B",
            "type": "bank",
            "ledger_balance": 50000,
            "as_of_date": "2026-01-31"
          },
          {
            "counterparty_id": "cp-C",
            "type": "ar",
            "ledger_balance": 15000,
            "as_of_date": "2026-01-31"
          },
          {
            "counterparty_id": "cp-E",
            "type": "ar",
            "ledger_balance": 9000,
            "as_of_date": "2026-01-31"
          }
        ]
      },
      "output_payload": {
        "tolerance_used": {
          "abs": 0,
          "pct": 2,
          "declared_by_caller": true
        },
        "total_confirmations": 4,
        "total_ledger_balances": 4,
        "matched_count": 1,
        "exact_count": 1,
        "tolerance_count": 0,
        "unmatched_count": 4,
        "duplicate_confirmation_keys": [],
        "duplicate_ledger_keys": [],
        "matched": [
          {
            "confirmation_id": "C-1",
            "counterparty_id": "cp-A",
            "type": "bank",
            "confirmed_balance": 100000,
            "ledger_balance": 100000,
            "variance": 0,
            "match_type": "EXACT_MATCH"
          }
        ],
        "unmatched": [
          {
            "confirmation_id": "C-2",
            "counterparty_id": "cp-B",
            "type": "bank",
            "confirmed_balance": 50100,
            "ledger_balance": 50000,
            "variance": 100,
            "reason": "MISMATCH"
          },
          {
            "confirmation_id": "C-3",
            "counterparty_id": "cp-C",
            "type": "ar",
            "confirmed_balance": 20000,
            "ledger_balance": 15000,
            "variance": 5000,
            "reason": "MISMATCH"
          },
          {
            "confirmation_id": "C-4",
            "counterparty_id": "cp-D",
            "type": "ar",
            "confirmed_balance": 7500,
            "ledger_balance": null,
            "variance": null,
            "reason": "NO_LEDGER_BALANCE"
          },
          {
            "confirmation_id": null,
            "counterparty_id": "cp-E",
            "type": "ar",
            "confirmed_balance": null,
            "ledger_balance": 9000,
            "variance": null,
            "reason": "NO_CONFIRMATION"
          }
        ]
      },
      "golden_hash": "523981b548d9798e9e7846feb2b2d0987327c544738fd67e9bc2e4f7c08c295d"
    },
    {
      "name": "default_zero_tolerance_mismatch",
      "description": "No tolerance declared (defaults to 0/0, exact match required). One confirmation off by $1 from ledger -- flags as MISMATCH under the exact-only default.",
      "policy_parameters": {
        "confirmations": [
          {
            "confirmation_id": "C-10",
            "counterparty_id": "cp-Z",
            "type": "bank",
            "confirmed_balance": 10001,
            "confirmation_date": "2026-06-30"
          }
        ],
        "ledger_balances": [
          {
            "counterparty_id": "cp-Z",
            "type": "bank",
            "ledger_balance": 10000,
            "as_of_date": "2026-06-30"
          }
        ]
      },
      "output_payload": {
        "tolerance_used": {
          "abs": 0,
          "pct": 0,
          "declared_by_caller": false
        },
        "total_confirmations": 1,
        "total_ledger_balances": 1,
        "matched_count": 0,
        "exact_count": 0,
        "tolerance_count": 0,
        "unmatched_count": 1,
        "duplicate_confirmation_keys": [],
        "duplicate_ledger_keys": [],
        "matched": [],
        "unmatched": [
          {
            "confirmation_id": "C-10",
            "counterparty_id": "cp-Z",
            "type": "bank",
            "confirmed_balance": 10001,
            "ledger_balance": 10000,
            "variance": 1,
            "reason": "MISMATCH"
          }
        ]
      },
      "golden_hash": "885c8fc0ce9c9dd067e50938f7f8c7e7d0a77a7bd70ef58cb21e9720187dced5"
    },
    {
      "name": "empty_population_edge",
      "description": "No confirmations and no ledger balances declared -- finite gate, zero matched, zero unmatched.",
      "policy_parameters": {
        "tolerance_abs": 0,
        "tolerance_pct": 0,
        "confirmations": [],
        "ledger_balances": []
      },
      "output_payload": {
        "tolerance_used": {
          "abs": 0,
          "pct": 0,
          "declared_by_caller": true
        },
        "total_confirmations": 0,
        "total_ledger_balances": 0,
        "matched_count": 0,
        "exact_count": 0,
        "tolerance_count": 0,
        "unmatched_count": 0,
        "duplicate_confirmation_keys": [],
        "duplicate_ledger_keys": [],
        "matched": [],
        "unmatched": []
      },
      "golden_hash": "2f28d5603193e09a8b52f1fafb4f2a1d2632888b40bb80dfe64876c6c21cd741"
    }
  ]
}
