{
  "process_id": "TR-06",
  "policy_version": "synthetic-v1",
  "event_id": "tr-06-example-v1",
  "input": {
    "cutoff": "2026-11-09T08:00:00Z",
    "entity_id": "LENDER",
    "currency": "USD",
    "contract_version": "illustrative-2026-11-v1",
    "sources": [
      {
        "source_id": "warehouse_ledger",
        "as_of": "2026-11-09T08:00:00Z",
        "received_at": "2026-11-09T08:00:00Z",
        "complete": true,
        "revision": "v1"
      },
      {
        "source_id": "facility_terms",
        "as_of": "2026-11-09T08:00:00Z",
        "received_at": "2026-11-09T08:00:00Z",
        "complete": true,
        "revision": "v1"
      },
      {
        "source_id": "warehouse_statement",
        "as_of": "2026-11-09T08:00:00Z",
        "received_at": "2026-11-09T08:00:00Z",
        "complete": true,
        "revision": "v1"
      }
    ],
    "period_start": "2026-11-01",
    "period_end": "2026-11-09",
    "day_basis": 360,
    "advance_id": "ADV-1",
    "funding_date": "2026-11-01",
    "maximum_age_days": 20,
    "collateral_principal_cents": 30000000,
    "principal_events": [
      {
        "event_id": "DRAW-1",
        "effective_date": "2026-11-01",
        "principal_after_cents": 28500000,
        "known_at": "2026-11-09T08:00:00Z"
      },
      {
        "event_id": "CURTAIL-1",
        "effective_date": "2026-11-05",
        "principal_after_cents": 18500000,
        "known_at": "2026-11-09T08:00:00Z"
      }
    ],
    "rates": [
      {
        "rate_id": "RATE-1",
        "effective_date": "2026-11-01",
        "annual_rate_bps": 600,
        "known_at": "2026-11-09T08:00:00Z"
      },
      {
        "rate_id": "RATE-2",
        "effective_date": "2026-11-07",
        "annual_rate_bps": 650,
        "known_at": "2026-11-09T08:00:00Z"
      }
    ],
    "fee_cents": 2500,
    "statement_interest_and_fee_cents": 34347
  },
  "expected": {
    "status": "carry_reconciliation_for_review",
    "interest_cents": 31847,
    "fee_cents": 2500,
    "total_carry_cents": 34347,
    "statement_difference_cents": 0,
    "ending_advance_cents": 18500000,
    "age_days": 8,
    "segments": [
      {
        "start": "2026-11-01",
        "end_exclusive": "2026-11-05",
        "days": 4,
        "principal_cents": 28500000,
        "annual_rate_bps": 600,
        "unrounded_interest_cents": "19000"
      },
      {
        "start": "2026-11-05",
        "end_exclusive": "2026-11-07",
        "days": 2,
        "principal_cents": 18500000,
        "annual_rate_bps": 600,
        "unrounded_interest_cents": "6166.666666666666666666666667"
      },
      {
        "start": "2026-11-07",
        "end_exclusive": "2026-11-09",
        "days": 2,
        "principal_cents": 18500000,
        "annual_rate_bps": 650,
        "unrounded_interest_cents": "6680.555555555555555555555556"
      }
    ],
    "duplicate_events": 0,
    "errors": []
  },
  "changes": [
    {
      "name": "One-dollar statement difference",
      "path": [
        "statement_interest_and_fee_cents"
      ],
      "value": 34447,
      "expected": {
        "status": "hold",
        "interest_cents": 31847,
        "fee_cents": 2500,
        "total_carry_cents": 34347,
        "statement_difference_cents": 100,
        "ending_advance_cents": 18500000,
        "age_days": 8,
        "segments": [
          {
            "start": "2026-11-01",
            "end_exclusive": "2026-11-05",
            "days": 4,
            "principal_cents": 28500000,
            "annual_rate_bps": 600,
            "unrounded_interest_cents": "19000"
          },
          {
            "start": "2026-11-05",
            "end_exclusive": "2026-11-07",
            "days": 2,
            "principal_cents": 18500000,
            "annual_rate_bps": 600,
            "unrounded_interest_cents": "6166.666666666666666666666667"
          },
          {
            "start": "2026-11-07",
            "end_exclusive": "2026-11-09",
            "days": 2,
            "principal_cents": 18500000,
            "annual_rate_bps": 650,
            "unrounded_interest_cents": "6680.555555555555555555555556"
          }
        ],
        "duplicate_events": 0,
        "errors": [
          "statement_difference"
        ]
      }
    },
    {
      "name": "Curtailment not applied in source ledger",
      "path": [
        "principal_events",
        1,
        "principal_after_cents"
      ],
      "value": 28500000,
      "expected": {
        "status": "hold",
        "interest_cents": 38792,
        "fee_cents": 2500,
        "total_carry_cents": 41292,
        "statement_difference_cents": -6945,
        "ending_advance_cents": 28500000,
        "age_days": 8,
        "segments": [
          {
            "start": "2026-11-01",
            "end_exclusive": "2026-11-05",
            "days": 4,
            "principal_cents": 28500000,
            "annual_rate_bps": 600,
            "unrounded_interest_cents": "19000"
          },
          {
            "start": "2026-11-05",
            "end_exclusive": "2026-11-07",
            "days": 2,
            "principal_cents": 28500000,
            "annual_rate_bps": 600,
            "unrounded_interest_cents": "9500"
          },
          {
            "start": "2026-11-07",
            "end_exclusive": "2026-11-09",
            "days": 2,
            "principal_cents": 28500000,
            "annual_rate_bps": 650,
            "unrounded_interest_cents": "10291.66666666666666666666667"
          }
        ],
        "duplicate_events": 0,
        "errors": [
          "statement_difference"
        ]
      }
    },
    {
      "name": "Missing opening rate",
      "path": [
        "rates"
      ],
      "value": [
        {
          "rate_id": "RATE-2",
          "effective_date": "2026-11-07",
          "annual_rate_bps": 650,
          "known_at": "2026-11-09T08:00:00Z"
        }
      ],
      "expected": {
        "status": "hold",
        "errors": [
          "invalid_input:missing_opening_principal_or_rate"
        ]
      }
    },
    {
      "name": "Identical curtailment replay",
      "append_path": [
        "principal_events"
      ],
      "append_value": {
        "event_id": "CURTAIL-1",
        "effective_date": "2026-11-05",
        "principal_after_cents": 18500000,
        "known_at": "2026-11-09T08:00:00Z"
      },
      "expected": {
        "status": "carry_reconciliation_for_review",
        "interest_cents": 31847,
        "fee_cents": 2500,
        "total_carry_cents": 34347,
        "statement_difference_cents": 0,
        "ending_advance_cents": 18500000,
        "age_days": 8,
        "segments": [
          {
            "start": "2026-11-01",
            "end_exclusive": "2026-11-05",
            "days": 4,
            "principal_cents": 28500000,
            "annual_rate_bps": 600,
            "unrounded_interest_cents": "19000"
          },
          {
            "start": "2026-11-05",
            "end_exclusive": "2026-11-07",
            "days": 2,
            "principal_cents": 18500000,
            "annual_rate_bps": 600,
            "unrounded_interest_cents": "6166.666666666666666666666667"
          },
          {
            "start": "2026-11-07",
            "end_exclusive": "2026-11-09",
            "days": 2,
            "principal_cents": 18500000,
            "annual_rate_bps": 650,
            "unrounded_interest_cents": "6680.555555555555555555555556"
          }
        ],
        "duplicate_events": 1,
        "errors": []
      }
    },
    {
      "name": "Aging exception",
      "path": [
        "maximum_age_days"
      ],
      "value": 5,
      "expected": {
        "status": "hold",
        "interest_cents": 31847,
        "fee_cents": 2500,
        "total_carry_cents": 34347,
        "statement_difference_cents": 0,
        "ending_advance_cents": 18500000,
        "age_days": 8,
        "segments": [
          {
            "start": "2026-11-01",
            "end_exclusive": "2026-11-05",
            "days": 4,
            "principal_cents": 28500000,
            "annual_rate_bps": 600,
            "unrounded_interest_cents": "19000"
          },
          {
            "start": "2026-11-05",
            "end_exclusive": "2026-11-07",
            "days": 2,
            "principal_cents": 18500000,
            "annual_rate_bps": 600,
            "unrounded_interest_cents": "6166.666666666666666666666667"
          },
          {
            "start": "2026-11-07",
            "end_exclusive": "2026-11-09",
            "days": 2,
            "principal_cents": 18500000,
            "annual_rate_bps": 650,
            "unrounded_interest_cents": "6680.555555555555555555555556"
          }
        ],
        "duplicate_events": 0,
        "errors": [
          "age_limit_requires_disposition"
        ]
      }
    },
    {
      "name": "Bad calendar date",
      "path": [
        "principal_events",
        1,
        "effective_date"
      ],
      "value": "2026-11-31",
      "expected": {
        "status": "hold",
        "errors": [
          "invalid_input:day is out of range for month"
        ]
      }
    },
    {
      "name": "Principal cannot predate supplied loan funding",
      "path": [
        "principal_events",
        0,
        "effective_date"
      ],
      "value": "2026-10-31",
      "expected": {
        "status": "hold",
        "errors": [
          "invalid_input:principal_outside_funding_accrual_window"
        ]
      }
    },
    {
      "name": "Future-known rate cannot enter historical accrual",
      "path": [
        "rates",
        1,
        "known_at"
      ],
      "value": "2026-11-09T09:00:00Z",
      "expected": {
        "status": "hold",
        "errors": [
          "invalid_input:rate:future_information"
        ]
      }
    }
  ]
}
