{
  "process_id": "FA-01",
  "policy_version": "synthetic-v1",
  "event_id": "fa-01-example-v1",
  "input": {
    "entity": "LENDER-1",
    "currency": "USD",
    "cutoff": "2026-10-31T23:59:59Z",
    "window_start": "2026-10-01T00:00:00Z",
    "events": [
      {
        "entity": "LENDER-1",
        "currency": "USD",
        "known_at": "2026-10-31T23:59:59Z",
        "event_id": "F1",
        "loan_id": "L1",
        "revision": 1,
        "event_type": "funded",
        "effective_date": "2026-10-30",
        "principal_cents": 30000000
      },
      {
        "entity": "LENDER-1",
        "currency": "USD",
        "known_at": "2026-10-31T23:59:59Z",
        "event_id": "F2",
        "loan_id": "L2",
        "revision": 1,
        "event_type": "funded",
        "effective_date": "2026-10-31",
        "principal_cents": 20000000
      }
    ],
    "expected_unique_events": 2,
    "control_principal_cents": 50000000,
    "manifest": {
      "events": {
        "as_of": "2026-10-31T23:59:59Z",
        "known_at": "2026-10-31T23:59:59Z",
        "expected_records": 2,
        "received_records": 2,
        "complete": true
      }
    }
  },
  "expected": {
    "status": "ready_for_review",
    "accepted_event_count": 2,
    "accepted_principal_cents": 50000000,
    "duplicate_rows": 0,
    "errors": []
  },
  "changes": [
    {
      "name": "Identical source event replay is counted once",
      "replace_input": {
        "entity": "LENDER-1",
        "currency": "USD",
        "cutoff": "2026-10-31T23:59:59Z",
        "window_start": "2026-10-01T00:00:00Z",
        "events": [
          {
            "entity": "LENDER-1",
            "currency": "USD",
            "known_at": "2026-10-31T23:59:59Z",
            "event_id": "F1",
            "loan_id": "L1",
            "revision": 1,
            "event_type": "funded",
            "effective_date": "2026-10-30",
            "principal_cents": 30000000
          },
          {
            "entity": "LENDER-1",
            "currency": "USD",
            "known_at": "2026-10-31T23:59:59Z",
            "event_id": "F2",
            "loan_id": "L2",
            "revision": 1,
            "event_type": "funded",
            "effective_date": "2026-10-31",
            "principal_cents": 20000000
          },
          {
            "entity": "LENDER-1",
            "currency": "USD",
            "known_at": "2026-10-31T23:59:59Z",
            "event_id": "F1",
            "loan_id": "L1",
            "revision": 1,
            "event_type": "funded",
            "effective_date": "2026-10-30",
            "principal_cents": 30000000
          }
        ],
        "expected_unique_events": 2,
        "control_principal_cents": 50000000,
        "manifest": {
          "events": {
            "as_of": "2026-10-31T23:59:59Z",
            "known_at": "2026-10-31T23:59:59Z",
            "expected_records": 3,
            "received_records": 3,
            "complete": true
          }
        }
      },
      "expected": {
        "status": "ready_for_review",
        "accepted_event_count": 2,
        "accepted_principal_cents": 50000000,
        "duplicate_rows": 1,
        "errors": []
      }
    },
    {
      "name": "Conflicting same event revision stays held",
      "replace_input": {
        "entity": "LENDER-1",
        "currency": "USD",
        "cutoff": "2026-10-31T23:59:59Z",
        "window_start": "2026-10-01T00:00:00Z",
        "events": [
          {
            "entity": "LENDER-1",
            "currency": "USD",
            "known_at": "2026-10-31T23:59:59Z",
            "event_id": "F1",
            "loan_id": "L1",
            "revision": 1,
            "event_type": "funded",
            "effective_date": "2026-10-30",
            "principal_cents": 30000000
          },
          {
            "entity": "LENDER-1",
            "currency": "USD",
            "known_at": "2026-10-31T23:59:59Z",
            "event_id": "F2",
            "loan_id": "L2",
            "revision": 1,
            "event_type": "funded",
            "effective_date": "2026-10-31",
            "principal_cents": 20000000
          },
          {
            "entity": "LENDER-1",
            "currency": "USD",
            "known_at": "2026-10-31T23:59:59Z",
            "event_id": "F1",
            "loan_id": "L1",
            "revision": 1,
            "event_type": "funded",
            "effective_date": "2026-10-30",
            "principal_cents": 30000100
          }
        ],
        "expected_unique_events": 2,
        "control_principal_cents": 50000000,
        "manifest": {
          "events": {
            "as_of": "2026-10-31T23:59:59Z",
            "known_at": "2026-10-31T23:59:59Z",
            "expected_records": 3,
            "received_records": 3,
            "complete": true
          }
        }
      },
      "expected": {
        "status": "hold",
        "accepted_event_count": 1,
        "accepted_principal_cents": 20000000,
        "duplicate_rows": 0,
        "errors": [
          "conflicting_event:F1",
          "unique_event_count_mismatch",
          "principal_control_mismatch"
        ]
      }
    },
    {
      "name": "Wrong principal control",
      "path": [
        "control_principal_cents"
      ],
      "value": 49999999,
      "expected": {
        "status": "hold",
        "accepted_event_count": 2,
        "accepted_principal_cents": 50000000,
        "duplicate_rows": 0,
        "errors": [
          "principal_control_mismatch"
        ]
      }
    },
    {
      "name": "Boolean principal is not an integer money amount",
      "path": [
        "events",
        0,
        "principal_cents"
      ],
      "value": true,
      "expected": {
        "status": "hold",
        "errors": [
          "invalid_input:principal_cents:expected_integer"
        ]
      }
    },
    {
      "name": "Future-known event cannot enter this cutoff",
      "path": [
        "events",
        0,
        "known_at"
      ],
      "value": "2026-11-01T00:00:00Z",
      "expected": {
        "status": "hold",
        "errors": [
          "invalid_input:events:future_known_row"
        ]
      }
    },
    {
      "name": "Unsupported canceled event cannot enter the funded cohort",
      "path": [
        "events",
        0,
        "event_type"
      ],
      "value": "canceled",
      "expected": {
        "status": "hold",
        "errors": [
          "invalid_input:event_type:unsupported_for_this_funded_cohort"
        ]
      }
    },
    {
      "name": "Prior-period funded event cannot enter this month cohort",
      "path": [
        "events",
        0,
        "effective_date"
      ],
      "value": "2026-09-01",
      "expected": {
        "status": "hold",
        "errors": [
          "invalid_input:effective_date:outside_funded_cohort_window"
        ]
      }
    },
    {
      "name": "Missing source page is an incomplete population",
      "path": [
        "manifest",
        "events",
        "received_records"
      ],
      "value": 0,
      "expected": {
        "status": "hold",
        "errors": [
          "invalid_input:events:incomplete_population"
        ]
      }
    },
    {
      "name": "Malformed source timestamp holds",
      "path": [
        "manifest",
        "events",
        "known_at"
      ],
      "value": "2026-13-32T00:00:00Z",
      "expected": {
        "status": "hold",
        "errors": [
          "invalid_input:events.known_at:invalid_utc_timestamp"
        ]
      }
    },
    {
      "name": "Old source as-of cannot satisfy the declared exact cutoff",
      "path": [
        "manifest",
        "events",
        "as_of"
      ],
      "value": "2026-10-01T00:00:00Z",
      "expected": {
        "status": "hold",
        "errors": [
          "invalid_input:events:invalid_source_cutoff"
        ]
      }
    }
  ]
}
